Digital Signal Processing Reference
In-Depth Information
of detection using the methods discussed above, the signal, especially when in the low frequency range
(say, 100-300 Hz), may be masked at times.
(k) Reconstruct the original test signal from the matrix Fty (this is essentially the reverse of the
procedure that created Fty ) and play it through the computer's audio system to verify that it is correct.
To perform the reconstruction, write a script having the following format:
function tdSig = LVxTDMat2SigVec(TDMat,SzWin,...
SampsOverLap)
% Generates a signal vector tdSig from a matrix of time
% domain frames of a signal, each frame of length SzWin,
% with SampsOverLap samples of overlap. The code
% determines which dimension of TDMat matches SzWin
% and assumes that the other dimension is the frame index.
% If neither dimension of TDMat matches SzWin, an error
% is thrown.
% Test call pair for OverLap=0
% OutMat = LVxVector2FramesInMatrix([0:1:33],8,0)
% tdSig = LVxTDMat2SigVec(OutMat,8,0)
% The following four lines of code, when run in sequence,
% return the input vector [0:1:33]:
% OutMat = LVxVector2FramesInMatrix([0:1:33],8,4);
% szO = size(OutMat);
% OutMat = OutMat.*(triang(8)*ones(1,szO(2)))
% tdSig = LVxTDMat2SigVec(OutMat,8,4)
The call
[T,F,B] = LVx_DetectContTone(0.008,1000,0,512,1,1)
results in the following output values (note that the two low frequencies are present in the audio file prior
to addition of the 1000 Hz tone):
ToneFreq = [46.9, 62.5, 1000]
Fnyq = 4000
BnSp = 15.625
and the following figures, as described above.
30. Write the m-code for the script
function LVxZxformFromSamps(b,a,NumzSamps,M,nVals)
% Receives a set of coefficients [b,a] representative of the
% z-transform of a sequence x[n] for which the unit circle is
% included in the ROC. NumzSamps samples of the z-transform
% of x[n] are computed, and then the complete z-transform is
% computed from the samples. From this, nVals samples of x[n]
% are reconstructed using numerical contour integration. The
% samples of X(z) are also used to reconstruct a periodic version
% of x[n] over nVals samples. Both reconstructed sequences, x[n]
% and the periodic version are plotted for comparison. M is the
% number of dense grid z-samples to use for the contour integration
% Test call:
Search WWH ::




Custom Search