Professional Documents
Culture Documents
LAB 13: Noise Reduction
LAB 13: Noise Reduction
Contents
1. Noise Reduction
2. Optimal Filter Design
3. Butterworth Filter Design
4. Chebyshev Filter Design
Ayk=2*abs(fft(y))/N;
Ayk(1)=Ayk(1)/2; % single-side spectrum of the filtered data
subplot(2,1,1); plot(n,y);
axis([0 length(v) -4 4]);
xlabel('Number of samples');
ylabel('Sample value');grid;
subplot(2,1,2);plot(f,Ayk(1:N/2+1));
axis([0 fs/2 0 1.5]);
xlabel('Frequency (Hz)');
ylabel('Amplitude |Y(f)| ');grid;
Filter design
– Window type = Hanning window
– Number of filter taps = 25
– Lowpass cutoff frequency = 2000 Hz
N=length(x);
f=[0:N/2]*fs/N;
Axk=2*abs(fft(x))/N; Axk(1)=Axk(1)/2;
subplot(2,1,2); plot(f,Axk(1:N/2+1));
xlabel('Frequency (Hz)');
ylabel('Amplitude Spectrum |X(f)| '); grid;
figure
N1=24; % filter degree
fc=2000/4000; % normalized cutoff frequency of 2000 Hz
B=fir1(N1,fc,hanning(N1+1));
y=filter(B,1,x);
Ayk=2*abs(fft(y))/N;Ayk(1)=Ayk(1)/2;
subplot(2,1,1); plot(t,y);
xlabel('Number of samples');
ylabel('Sample value');grid;
title('Enhanced Speech and its Spectrum');
subplot(2,1,2); plot(f,Ayk(1:N/2+1));
xlabel('Frequency (Hz)');
ylabel('Amplitude Spectrum |Y(f)| ');grid;
pause;
sound(x/max(abs(x)),fs);
pause
sound(y/max(abs(y)),fs);
For data sampled at 1000 Hz, design a lowpass filter with less
than 3 dB of ripple in the passband, defined from 0 to 40 Hz,
and at least 60 dB of attenuation in the stopband, defined
from 150 Hz to the Nyquist frequency (500 Hz).