how to filter noise?
1 次查看(过去 30 天)
显示 更早的评论
How to play the sound to compare the filter sound..?? tq
[y,Fs,bits] = wavread('voice.wav');
Nsamps = length(y);
t = (1/Fs)*(1:Nsamps); %Prepare time data for plot
%Do Fourier Transform
y_fft = abs(fft(y)); %Retain Magnitude
y_fft = y_fft(1:Nsamps/2); %Discard Half of Points
f = Fs*(0:Nsamps/2-1)/Nsamps; %Prepare freq data for plot\][p
%Plot Sound File in Time Domain
figure
plot(t, y)
xlabel('Time (s)')
ylabel('Amplitude')
title('Tuning Fork A4 in Time Domain')
%Plot Sound File in Frequency Domain
figure
plot(f, y_fft)
xlim([0 1000])
ylim([0 1800])
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('Frequency Response of voice')
Fs = 44100; % Sampling Frequency
N = 1000; % Order
Fc1 = 800; % First Cutoff Frequency
Fc2 = 1000; % Second Cutoff Frequency
flag = 'scale'; % Sampling Flag
% Create the window vector for the design algorithm.
win = hamming(N+1);
% Calculate the coefficients using the FIR1 function.
b = fir1(N, [Fc1 Fc2]/(Fs/2), 'stop', win, flag);%
newy=conv(y,b);
wavwrite(newy,Fs,bits,'your-group-number');
0 个评论
回答(2 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Filter Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!