Power spectral density of filter output due to roundoff noise
hpsd = noisepsd(sysobj,L)
hpsd = noisepsd(sysobj,L,param1,value1,param2,value2,...)
hpsd = noisepsd(sysobj,L,opts)
hpsd = noisepsd(sysobj,L) computes
the power spectral density (PSD) at the output of filter System
occurring because of roundoff noise. This noise is produced by quantization
errors within the filter.
L is the number of trials
used to compute the average. The PSD is computed from the average
L trials. The more trials you specify,
the better the estimate, but at the expense of longer computation
time. When you do not explicitly specify
default is 10 trials.
hpsd is a
psd data object.
To extract the PSD vector (the data from the PSD) from
at the prompt. Plot the PSD data with
The average power of the output noise (the integral of the PSD) can
be computed with
avgpower, a method of
avgpwr = avgpower(hpsd).
hpsd = noisepsd(sysobj,L,param1,value1,param2,value2,...) where
a filter System
object, specifies optional parameters via propertyname/propertyvalue
psd object property values are:
Description and Valid Entries
Specify the number of FFT points to use to calculate the PSD.
Determine whether to use normalized frequency. Enter
a logical value of
Specify the sampling frequency to use when you set
Shift the zero-frequency component to the center of a two-sided spectrum.
|Analyze the filter System
object, based on the arithmetic
specified in the |
If the spectrum data you specify is calculated over half the Nyquist interval and you do not specify a corresponding frequency vector, the default frequency vector assumes that the number of points in the whole FFT was even. Also, the plot option to convert to a whole or two-sided spectrum assumes the original whole FFT length is even.
noisepsd requires knowledge of the input
data type. Analysis cannot be performed if the input data type is
not available. If you do not specify the
i.e., use the syntax
[h,w] = noisepsd(sysobj) ,
then the following rules apply to this method:
object state is
object state is
analysis based on the locked input data type.
If you do specify the
i.e., use the syntax
[h,w] = noisepsd(sysobj,'Arithmetic',
ARITH), review the following rules for this method. Which
rule applies depends on the value you set for the
|System Object State||Rule|
|When the input data type is double or single, then |
|When the input data is of fixed-point type, |
The following Filter System objects are supported by this analysis function:
|Filter System objects|
hpsd = noisepsd(sysobj,L,opts) uses
an options object,
opts, to specify the optional
input arguments. This specification is not made using property-value
pairs in the command. Use
opts = noisepsdopts(sysobj) to
create the object.
opts then has the
sysobj. After creating
you change the property values before calling
set(opts,'fs',48e3); % Set Fs to 48 kHz.
no output argument launches fvtool.
Compute the PSD of the output noise caused by the quantization processes in a fixed-point, direct form FIR filter. The input is of fixed-point type.
noisepsd performs analysis based on the locked input data type.
b = firgr(27,[0 .4 .6 1],[1 1 0 0]); firfilt = dsp.FIRFilter('Numerator',b); % Create the filter object. data = fi(randn(15,16),1,16,3); output = firfilt(data);
Quantize the filter to fixed-point.
hpsd = noisepsd(firfilt,'Arithmetic','fixed'); plot(hpsd)
hpsd looks similar to the following figure - the data resulting from the noise PSD calculation. You can review the data in hpsd.data.
 McClellan, et al., Computer-Based Exercises for Signal Processing Using MATLAB 5. Upper Saddle River, N.J.: Prentice-Hall, 1998.