How can I make my high pass filter more accurate?

3 次查看(过去 30 天)
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

采纳的回答

Ridwan Alam
Ridwan Alam 2019-12-11
编辑:Ridwan Alam 2019-12-11
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 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by