Digital Signal Processing Reference
In-Depth Information
% samples of delay to impose on x1 and x2 to demonstrate shift invariance.
% Test calls:
% LVxLinearab(2,5,3,5,128,0,[2])
% LVxLinearab(2,-3,13,5,128,0,[2,-1,1,2])
17. Write the m-code for the script
LV xNLSabXSq(a, b, f 1 ,f 2 ,N,Del,NLCoeff)
as described in the text and which produces the plots shown and described in Fig. 2.19.
function LVxNLSabXSq(a,b,f1,f2,N,Del,NLCoeff )
% Demonstrates that the principle of superposition is not true for
% a nonlinear system defined by NLSCoeff, the
% coefficients of which weight an input sequence and delayed
% versions thereof raised to the second power, i.e.,
% NLS(x) = c[0]xˆ2[n] + c[1]xˆ2[n-1] + c[2]x ˆ2[n-2] + ...
% where c{n} are the members of the vector NLSCoeff.
% a and b are constants, and f1 and f2 are frequencies of cosine
% and sine waves, respectively, that are used as x1 and x2 in
% the superposition test i.e., does NLS(ax1 + bx2) =
% aNLS(x1)+ bNLS(x2)?
% N is the length of the test sequences x1 and x2, and Del is
% a number of samples of delay to impose on x1 and x2
% test for shift invariance.
% Test call:
% LVxNLSabXSq(2,-3,13,5,128,0,[2,-1,1,2])
The writing of the script can be modularized by first writing a script that will take the input
coefficients NLCoeff and generate the system output for a given input or test sequence x
[
n
]
:
function [yC,nC] = LVxNLSofXSq(NLCoeff,x)
% Delays, weights, and sums the square of the
% input sequencex(=x[n] with n = 0:1:length(x)-1)
% according to yC = c(0)*x(n).ˆ2 + c(1)*x(n-1).ˆ2+...
% with NLCoeff (= [c[0],c[1],c[2],...]) and
% nC are the sample indices of yC.
% Test call:
% [yC,nC] = LVxNLSofXSq([1,-2,1],cos(2*pi*12*[0:1:63]/64) )
18.The real part of a power sequence generated from a certain complex number z having magnitude
1.0, results in 8 cycles of a cosine wave over a total of 32 samples. What is the value of z ?
19. What complex number of magnitude 1.0 will generate two cycles of a complex sinusoid when
raised to the power sequence 0:1:11?
20. How many cycles of a complex sinusoid are generated when the complex number
cos (π/ 180 )
+
j sin (π/ 180 )
is raised to the power sequence n = 0:1:539?
21. Write a script conforming to the following call syntax
Search WWH ::




Custom Search