How can I make my high pass filter more accurate?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Nicolas Picon
el 11 de Dic. de 2019
Editada: Ridwan Alam
el 11 de Dic. de 2019
Hello everyone,
So, I am doing a project with a sound file of my voice and applying some filters to it and finding the fourier transforms.
My code (just a little part) is:
[y,Fs] = audioread('myvoice.m4a');
L = length(y);
f = Fs*(0:(L/2))/L; %frequency
y_HPF_270 = highpass(y,270,Fs);
%270Hz
%plot fourier transform of HPF
%set up
% Compute the two-sided spectrum P2. Then compute the single-sided spectrum P1 based on P2 and the even-valued signal length L.
P2_HPF270 = abs(yf_HPF_270/L);
P1_HPF270 = P2_HPF270(1:L/2+1);
P1_HPF270(2:end-1) = 2*P1_HPF270(2:end-1);
%plot
subplot(3,2,6);
plot(f,P1_HPF270)
title('Single-Sided Amplitude Spectrum of HPF 270Hz')
xlabel('f (Hz)')
ylabel('|P1(f)|')
From what I understand from High Pass filters is that i filters the frequencies that are below a cutoff frequency. If my cutoff frequency is 270 Hz, why do I get still frequencies below 270?
The fourier Transform graph taht I get is:
![HPF_270Hz.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/253932/HPF_270Hz.jpeg)
0 comentarios
Respuesta aceptada
Ridwan Alam
el 11 de Dic. de 2019
Editada: Ridwan Alam
el 11 de Dic. de 2019
If my cutoff frequency is 270 Hz, why do I get still frequencies below 270?
Unless it's an ideal highpass filter, most filter implementations show a transition band where the attenuation starts to take effect. You can find more details here:
To get steeper response, try this:
highpass(y,270,Fs,'Steepness',0.99,'StopbandAttenuation',100)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!