• Nie Znaleziono Wyników

Description Syntax freqz

N/A
N/A
Protected

Academic year: 2021

Share "Description Syntax freqz"

Copied!
5
0
0

Pełen tekst

(1)

Filter Design Toolbox

freqz

Compute the frequency response of quantized filters

Syntax

[h,w] = freqz(hq,n) h = freqz(hq,w)

[h,w] = freqz(hq,n,'whole')

[h,w,units,href] = freqz(hq,...) [h,f] = freqz(hq,n,fs)

h = freqz(hq,f,fs)

[h,f] = freqz(hq,n,'whole',fs) [h,f,s] = freqz(hq,...)

[h,f,units,href] = freqz(hq,...,fs) freqz(hq,...)

Description

[h,w] = freqz(hq,n) returns the frequency response vector h and the corresponding frequency vector w for the quantized filter hq. freqz uses the transfer function associated with the quantized filter to calculate the frequency response of the filter. The vectors h and w are both of length n. The frequency vector w has values ranging from 0 to radians per sample. If you do not specify the integer n, or you specify it as the empty vector [], the frequency response is calculated using the default value of 512 samples.

h = freqz(hq,w) returns the frequency response vector h calculated at the frequencies (in radians per sample) supplied by the vector w. The vector w can have any length.

[h,w] = freqz(hq,n,'whole') uses n sample points around the entire unit circle to calculate the frequency response. Frequency vector w has length n and values ranging from 0 to 2 radians per sample.

(2)

[h,w,units,href] = freqz(hq,...) returns the optional string argument units, specifying the units for the frequency vector w. The string returned in units is 'rad/sample', denoting radians per sample. The optional output argument href is the frequency response of the transfer function associated with the reference filter used to specify the quantized filter hq.

[h,f] = freqz(hq,n,fs) returns the frequency response vector h and the corresponding frequency vector f for the quantized filter hq. The vectors h and f are both of length n. The frequency response calculation uses the sampling frequency specified by the scalar fs (in Hz). The frequency vector f has values ranging from 0 to (fs/2) Hz.

h = freqz(hq,f,fs) returns the frequency response vector h calculated at the frequencies (in Hz) supplied in the vector f. Vector f can be any length.

[h,f] = freqz(hq,n,'whole',fs) uses n points around the entire unit circle to calculate the frequency response. Frequency vector f has length n and has values ranging from 0 to fs Hz.

[h,f,s] = freqz(hq,...) returns the structure s with the following fields:

s.xunits--a string specifying the frequency axis units. The contents of s.xunits can be one of the following:

'rad/sample' (default) -

-'Hz' 'kHz' -

'MHz' -

'GHz' -

A user-specified string -

s.yunits--a string specifying the vertical axis units. The contents of s.yunits can be one of the following:

'dB' (default) -

'linear' -

'squared' -

(3)

s.plot--a string specifying the type of plot to produce. The contents of s.plot can be one of the following:

'both' (default) -

'mag' -

'phase' -

[h,f,units,href] = freqz(hq,...,fs) returns the optional MATLAB structure units, that freqzplot uses for plotting. The string returned in units is 'Hz' for hertz. The optional output argument href is the frequency response of the transfer function associated with the reference filter used to specify the

quantized filter hq.

freqz(hq,...) plots the magnitude and unwrapped phase of the frequency response of the quantized filter hq in the current figure window.

Remarks

There are several ways of analyzing the frequency response of quantized filters.

freqz accounts for quantization effects in the filter coefficients, but does not account for quantization effects in filtering arithmetic. To account for the quantization effects in filtering arithmetic, refer to function nlm.

Algorithm

freqz calculates the frequency response for a quantized filter from the filter transfer function Hq(z). The complex-valued frequency response is calculated by evaluating Hq(ej ) at discrete values of wspecified by the syntax you use. The integer input argument n determines the number of equally-spaced points around the upper half of the unit circle at which freqz evaluates the frequency response.

The frequency ranges from 0 to radians per sample when you do not supply a sampling frequency as an input argument. When you supply the scalar sampling frequency fs as an input argument to freqz, the frequency ranges from 0 to fs/2 Hz.

To calculate the transfer function associated with a quantized filter, freqz uses the values of the QuantizedCoefficients and FilterStructure properties.

(4)

When you include the optional output argument href in the command, freqz uses the value of the ReferenceCoefficients property to calculate the frequency response of the reference filter transfer function.

Examples

Plot the estimated frequency response of a quantized filter.

b = fir1(80,0.5,kaiser(81,8));

hq = qfilt('fir',{b});

[h,w,units,href] = freqz(hq);

plot(w,20 * log10(abs(h)),'-',w,20 * log10(abs(href)),'--') legend('Quantized filter','Reference filter',3)

xlabel('Frequency in rad/sample') ylabel('Magnitude in dB')

title('Magnitude of the Frequency Response Compared')

(5)

See Also

qfilt

fvtool in your Signal Processing Toolbox documentation

fractionlength get

Cytaty

Powiązane dokumenty

A m biw alentny stosunek Czerwińskiego do anali­ zy sem iotycznej, jego nieufność w stosunku do ta ­ kiego postępow ania badaw czego jest

Wąbrzeźno, studiował- w latach 1950—1954 na Wydziale Prawa Uniwersytetu Poznańskiego, uzyskał stopień doktora nauk prawnych na podstawie rozprawy pt- Ochrona trwałości

6.2.18-19; Kennedy, Classical Rhetoric and Its Christian and Secular Tradition from Ancient to Modern Times, 82; Kennedy, New Testament Interpretation through Rhetorical

Laboratory tests of the effect of the contact time of the preflush fluid on the purification of the annular space were conducted by determining the adhesion of the cement sheath

Time-domain electromagnetic field transmission between small loop antennas on a half-space with conductive and dielectric properties.. Please check the document

The filter function filters a data sequence using a digital filter which works for both real and complex inputs.. The filter is a direct form

Autorka, wychodząc z założenia, że tożsamość nie jest konstruktem stałym, lecz kompleksem zmieniających się identyfikacji, próbowała ustalić, czyja

Zasada wolności pracy zawarta w Konstytucji RP stanowi podstawową normę ochronną, mieszczącą się w kategorii praw człowieka. Jak słusznie zauważono w literaturze, jest