Signal is not getting filtered properly

2 visualizaciones (últimos 30 días)
Giggs B.
Giggs B. el 23 de Jul. de 2021
Editada: Chunru el 23 de Jul. de 2021
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 comentarios
Giggs B.
Giggs B. el 23 de Jul. de 2021
My desired freq is variable since I am still in developng stage of my project and finding the best cut-off frequency. But for now my desired frequencies are above 500 Hz and undesired frequencies are below 500 Hz. My desired filter response is also variable but considering 1 dB passband and 25 dB stopband attenution, I want the transition phase to be as small as possible so as to prevent frequencies below 500 Hz as much as possible, also I don't mind attenuating my signal by some amount (<20 dB for example).
But I don't understand why the transition phase is ~2.5 KHz instead of 500 Hz.
Chunru
Chunru el 23 de Jul. de 2021
Editada: Chunru el 23 de Jul. de 2021
the cut off is at (500/510) in normalized freq and (500/510)*fs/2=21618Hz (not ~2.5kHz) while you want a cut-off at 500Hz.

Iniciar sesión para comentar.

Respuesta aceptada

Chunru
Chunru el 23 de Jul. de 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);

Más respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by