Digital Signal Processing Reference
In-Depth Information
% LVxTestReconSineVariablePhase(0,32,90)
% LVxTestReconSineVariablePhase(16,32,90)
% LVxTestReconSineVariablePhase(1,32,45)
19. Write a script that implements the function of the script LVxFreqTest . The script should receive
the arguments shown in the function definition below, compute the Real DFT coefficients one-by-one
using Eqs. (4.11) and (4.12), and then synthesize the original test signal from the coefficients using
Eq. (4.13). Three figures should be created, the first one having two subplots and being the analysis
window, in which a given set (real and imaginary) of analysis basis functions (i.e., test correlators) having
frequency dispFreq is plotted against the test signal, and the correlation value according to the Real DFT
analysis formula is computed and displayed. The second figure is the synthesis window and should have
three subplots, the first two being an accumulation of weighted basis harmonics, and the third being the
final reconstruction.The third figure has two subplots and should show the real and imaginary coefficients.
Test your script with all six test signals. Examples of each of the three windows are shown in the text.
function LVxFreqTest(TestSignalType,N,UserTestSig,dispFreq)
% TestSignalType may be passed as 1-7, as follows:
% 1 yields TestSig = sin(2 π t) + 1.25cos(4 π t+2 π (60/360)) +
% 0.75cos(12 π t+2 π (330/360))
% 2 yields TestSig = sin(4 π t+ π /6)
% 3 yields TestSig = sin(5.42 π t)
% 4 yields TestSig = 0.25 + cos(2.62 π t+ π /2) + sin(5.42 π t+ π/ 6)
% 5 yields TestSig = sin(2 π t) + 1.25cos(4 π t)+ 0.75cos(10 π t)
% 6 yields TestSig = sin(4 π t);
% 7 uses the test signal supplied as the third argument. Pass this
% argument as [] when TestSignalType is other than 7.
% N is the test signal length and must be at least 2. When
% TestSignalType is passed as 7, the value passed for N is
% overridden by the length of UserTestSig. In this case, N may
% be passed as the empty matrix [] or an arbitrary number if desired.
% dispFreq is a particular correlator frequency which is used to
% create two plots, one showing the test signal chosen by
% TestSignalType and the test correlator cosine of frequency
% dispFreq, and another showing the test signal chosen by
% TestSignalType and the test correlator sine of frequency dispFreq.
% Test Calls:
% LVxFreqTest(5,32,[])
% LVxFreqTest(4,19,[])
% LVxFreqTest(7,11,[cos(2*pi*(2.6)*(0:1:10)/11)])
20. The script LV F reqResp was presented earlier in the chapter. It evaluated the frequency
response of a test signal of length N by correlating the test signal with many test correlators of length N
having frequencies evenly spaced between 0 and π radians. In this exercise we develop a method which
pads the test signal with zeros to a length equal to a user-desired correlator length, and then performs
the Real DFT using the zero-padded test signal
function [FR] = LVxFreqRespND(tstSig, LenCorr)
% FR = LVxFreqRespND([ones(1,32)], 128)
% Pads tstSig with zeros to a length equal to LenCorr,
Search WWH ::




Custom Search