DSP Cep
DSP Cep
load('noisy_signal.mat')
y = (noisy_signal);
time = 10;
[l w] = size(noisy_signal);
Fs = l/time;
n = [0:1:length(noisy_signal)-
1]*1/Fs;
figure (1)
plot(n,y)
title('Noisy Signal');
xlabel('Time (s)');
ylabel('Amplitude');
//Fourier Transform of Noisy Sig
NFFT_input =
2^nextpow2(L_input)
Y = fft(input,NFFT_input)/L_input;
f=
Fs/2*linspace(0,1,NFFT_input/2+1)
;
plot(f,(abs(Y(1:NFFT_input/2+1))))
xlabel('Frequency(Hz)')
ylabel('Magnitude')
title('Spectrum of Noisy Signal')
Now to find the frequencies of noise
fir_L = fir1(412,wp_L,'stop',hann(413));
fir_H = fir1(412,wp_H,'stop',hann(413));
fir_filter = conv(fir_L,fir_H);
filtered_signal=conv( fir_filter,input);
IIR design using Butter() and Butterord()
Ap = 0.1; As = 32;
wp1 = 370/4000; wp2 = 470/4000 ; ws1 = 410/4000; ws2 = 430/4000
;
wp3 = 700/4000; wp4 = 800/4000 ; ws3 = 740/4000; ws4 = 760/4000
;
[NL,WcL] = buttord([wp1 wp2],[ws1 ws2],Ap,As)
[BL,AL] = butter(NL,WcL,'stop’);
Bt=conv(BL,BH);
At=conv(AL,AH);
filtered_signal=filter( Bt,At,noisy_signal);