freqz - Frequency response of the multirate multistage filter - MATLAB (original) (raw)
Frequency response of the multirate multistage filter
Syntax
Description
[[h](#d126e481257),[f](#d126e481231)] = freqz([sysobj](#d126e481127),[n](#d126e481166),[range](#d126e481196))
returns the complex frequency response, h
, of the multirate multistage filter System object™ and the frequency vector f
at whichh
is computed. n
is the number of frequency points, and range
is the frequency range over which the response is computed.
For the sample rate converter object, the sample rate is the larger ofInputSampleRate
andOutputSampleRate
.
[[h](#d126e481257),[f](#d126e481231)] = freqz([sysobj](#d126e481127),[f](#d126e481231))
returns the complex frequency response h
computed at the frequency points specified by vector f
. The input vectorf
is in Hz.
Examples
Create a multistage sample rate converter with default properties, corresponding to the combined three filter stages used to convert from 192 kHz to 44.1 kHz. Compute and display the frequency response.
src = dsp.SampleRateConverter; [H,f] = freqz(src); plot(f,20*log10(abs(H)))
Compute and display the frequency response over the range between 20 Hz and 44.1 kHz.
f = 20:10:44.1e3; [H,f] = freqz(src,f); plot(f,20*log10(abs(H)))
Compute the complex frequency response of a complex bandpass decimator using the freqz
function.
Create a dsp.ComplexBandpassDecimator
object. Set the DecimationFactor
to 12, the CenterFrequency
to 5000 Hz, and the SampleRate
to 44100 Hz. Compute and display the frequency response.
cbp = dsp.ComplexBandpassDecimator(12,5000,44100); [h,f] = freqz(cbp); plot(f,20*log10(abs(h))) grid on xlabel("Frequency (Hz)") ylabel("h (dB)")
Input Arguments
Number of frequency points for response evaluation, specified as a positive integer scalar. If n
is not specified, the default is 8192.
Data Types: single
| double
Range considered when computing the frequency response, specified as either 'half'
(from 0 to π) or'whole'
(from 0 to 2_π_). Ifrange
is not specified, the defaults is'half'
.
Frequencies in Hz at which the response is computed, specified as a vector.
Data Types: double
Output Arguments
Complex frequency response, returned as a vector.
Data Types: double
Complex Number Support: Yes
Frequencies at which the response is computed, returned as a vector.
Data Types: double
Version History
Introduced in R2018a