Signal is not getting filtered properly
2 views (last 30 days)
Show older comments
Hi,
I am trying to implement 4th order high pass elliptical filter with cut-off frequency at 500/510 Hz at 20 dB passband and 25 dB stopband attenuation. I have attached the plot for my original data and data after filtering. But if you see the filtered data, there is almost no data after 500
[b,a]=ellip(4,20,25,500/510,'high');
fvtool(b,a)
y2=audioread('fr1.mp3');
y_b2=filter(b,a,y2);
fs=44100;
N=length(y_b2);
time=N/fs;
t = linspace(0, time, N);
referenceLength=length(y_b2);
fref=fs*(1:referenceLength)/referenceLength;
R=fft(y_b2,referenceLength);
stor=R(1);
R(1)=0;
absR=abs(R);
plot(fref,absR);
xlim([0 2000]);
ylim([0 200]);
xticks([0 200 400 600 800 1000 1200 1400 1600 1800 2000]);
yticks([0 25 50 75 100 125 150 175 200 300 400 500 600 700 800 900 1000]);
grid on;
xlabel('Frequency(Hz)');
ylabel('Amplitude');
5 Comments
Accepted Answer
Chunru
on 23 Jul 2021
Try design the filters as follows. The filter will attenuate the frequency content below 500Hz. When plotting spectrum, you may consider log scale of the ampiltude (20*log10(abs(filtered_date))).
fs=44100;
% The filter to have 1dB ripples in passband, 40 dB attenuation in stop
% band, the cut-off freq of 500Hz. (you may adjust the value as you want)
[b,a]=ellip(4, 1, 40, 500/(fs/2),'high');
%fvtool(b,a)
freqz(b, a, 8192, fs);
0 Comments
More Answers (0)
See Also
Categories
Find more on Filter Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!