How can I make my high pass filter more accurate?

조회 수: 3 (최근 30일)
Nicolas Picon
Nicolas Picon 2019년 12월 11일
편집: Ridwan Alam 2019년 12월 11일
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