Simple MATLAB code to plot a BiQuad Filter from the coefficients?

조회 수: 7 (최근 30일)
Mike M
Mike M 2020년 5월 9일
답변: Star Strider 2020년 5월 9일
A BiQuad filter takes the following form:
The manual gives examples of how to use "freqz" for plotting frequency of functions and "phasez" for phase:
But none of these specifically handle a situation where you are trying to define a BiQuad filter by the standard variables g, B1, B2, a1, and a2.
I know we also have for inputting a biquad:
y = biquad(x,num,den,g)
But I'm still not sure how to get the coefficients entered correctly as it says num and den can store 3 variables each, and I just need two, plus it's obviously important the right coefficient goes in the right place.
What is a simple code to enter a filter based on these specific 5 variables and then plot it for freq/phase?
Also they demonstrate there how to convert the y axis between dB and magnitude from 0-1. But they don't show how to convert the x-axis to frequency in Hz. If it's simple, how can you plot with freq in Hz?
Thanks for any answers.

답변 (1개)

Star Strider
Star Strider 2020년 5월 9일
I don’t have the DSP Toolbox, so I can’t experiment with dsp.BiquadFilter objects.
According to the documentation use this syntax with freqz:
to analyse your filter.

카테고리

Help CenterFile Exchange에서 Statistics and Linear Algebra에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by