Generates the magnitude responses at specified frequencies for an analog or digital filter described by the numerator and denominator coefficients of its transfer function. |
||
Syntax |
Response = MagRes(Num, Den, Freq, SampleRate) |
|
Arguments |
Name |
Description |
|
Num |
Vector of numerator coefficients in descending power of s or z. |
|
Den |
Vector of denominator coefficients in descending power of s or z. |
|
Freq |
Vector of frequency points (Hz) where the magnitudes are calculated. For digital filters, the frequency should range from 0 to half the sample rate (Nyquist frequency). |
|
SampleRate (optional) |
A positive scalar specifying the sample rate in Hz. The SampleRate is included for a digital filter. It is omitted for an analog filter. |
Output |
Name |
Description |
Response |
A vector of magnitude response of length equal to that of vector Freq. |
|
Example |
Find magnitude response for a sampling rate of 1000Hz at various frequency points (stored in Freq) by a filter whose numerator and denominator coefficients are given by vectors b and a. |
|
|
Syntax |
|
|
Response = MagRes(b,a,freq, 1000) |
|
|
Result |
|
|
Response is a vector of the magnitude response at all points in Freq. |
|
See Also: |