Final DSP
Final DSP
By:
204146 Mayank Singh Bisht
204168 S Sashank Bhamidipati
Course
Digital Signal Processing
Year
B.Tech III ECE
OBJECTIVE
To understand the working of a digital hearing aid that filters noise and then enhances
the filtered output by an audio equalizer, using MATLAB.
INTRODUCTION
Digital hearing aids are used to improve the hearing ability of people with hearing
impairments. They are designed to filter out unwanted noise and enhance the audio
signals to make them more audible. In this project, we aim to implement a digital
hearing aid that filters out noise and enhances the audio signal using MATLAB.
THEORY
Digital hearing aids are electronic devices that help people with hearing impairments
by amplifying the sound and improving their ability to hear. The devices consist of a
microphone, a signal processing unit, an amplifier, and a speaker. The microphone
captures the sound and converts it into an electrical signal. The signal processing unit
then filters the electrical signal to remove unwanted noise and enhances it to improve
the audio quality. The amplified signal is then sent to the speaker, which converts the
electrical signal back into sound that the user can hear.
Filtering: In this project, we focus on filtering the electrical signal using a 4th-order
Butterworth filter. A 4th order Butterworth filter is a type of low-pass filter that allows
low-frequency signals to pass through while attenuating high-frequency signals. This
filter has a slope of 24 dB per octave (80 dB per decade) and a cut-off frequency at
which the power of the signal is attenuated to half its maximum value (-3 dB point). In
a 4th order Butterworth LPF, the filter response rolls off at a rate of 24 dB per octave
beyond the cut-off frequency, which is a relatively steep roll off compared to low-
order filters. This results in a narrower transition band, which is the range of
frequencies between the passband and the stopband where the filter response is
changing. The cutoff frequency of the filter determines the frequency at which the
filter starts to attenuate the signal. The Butterworth filter is designed using the
frequency domain approach, where the filter coefficients are calculated in the
frequency domain and then transformed back to the time domain using an inverse
Fourier transform.
Equalization: Equalization is the process of adjusting the frequency response of a
signal to achieve a desired sound quality. In this project, we use a peaking equalizer to
boost the amplitude of a specific frequency band. The peaking equalizer consists of a
bandpass filter and a gain stage. The bandpass filter selects a specific frequency band,
and the gain stage amplifies the selected band by a specified amount. The center
frequency of the bandpass filter determines the frequency band to be boosted, and the
bandwidth determines the range of frequencies around the center frequency to be
affected. The gain adjustment in dB determines the amount of amplification to be
applied to the selected frequency band.
METHODOLOGY
The project consists of two major parts - filtering and equalization. The first step
involves loading the noisy audio recording and specifying filter parameters such as
order and cut-off frequency. We then convert the cut-off frequency to the normalized
frequency range, perform FFT on the input signal, and design Butterworth filter
coefficients in the frequency domain. The filter is then applied in the frequency
domain by multiplying the FFT of the input signal with the filter coefficients. The
filtered signal is obtained by performing inverse FFT and extracting the real part of
the filtered signal.
In the second step, we define equalizer parameters such as center frequency,
bandwidth, and gain adjustment in dB. We then create the equalizer filter coefficients
using a function that calculates the numerator and denominator coefficients. The filter
coefficients are then normalized, and the equalizer is applied to the filtered signal
using MATLAB's built-in filter function.
MATLAB Code
% Load the noisy recording
[x, fs] = audioread('speech_n.wav');
Equalizer function
% Function to design equalizer filter coefficients
function [b, a] = equalizerCoefficients(centerFreq, bandwidth, gain, fs)
% Convert the center frequency and bandwidth to radians per sample
wc = 2 * pi * centerFreq / fs;
wb = 2 * pi * bandwidth / fs;
speech_n.wav
enhanced_speech.wav
CONCLUSION
In conclusion, digital hearing aids are essential devices that help people with hearing
impairments to improve their hearing ability. In this project, we implemented a digital
hearing aid using MATLAB, which filters out unwanted noise using a Butterworth
filter and enhances the audio signal using a peaking equalizer. The results indicate that
the audio quality has improved after filtering and equalization. The project can be
extended further by implementing real-time processing and exploring different types
of filters and equalizers to achieve better audio quality.