Digital Signal Processing Reference
In-Depth Information
% [T,F,B] = LVx_DetectContTone(0.011,100,0,512,1,1)
% [T,F,B] = LVx_DetectContTone(0.008,100,0,512,0,1)
% [T,F,B] = LVx_DetectContTone(0.005,94,0,512,0,1)
% [T,F,B] = LVx_DetectContTone(0.07,150,0,512,1,3)
% [T,F,B] = LVx_DetectContTone(0.011,200,0,512,1,1)
% [T,F,B] = LVx_DetectContTone(0.01,200,0,512,1,2)
% [T,F,B] = LVx_DetectContTone(0.1,200,0,512,1,3)
% [T,F,B] = LVx_DetectContTone(0.01,210,0,512,1,1)
% [T,F,B] = LVx_DetectContTone(0.025,200,1,512,1,1)
% [T,F,B] = LVx_DetectContTone(0.02,200,1,512,1,2)
% [T,F,B] = LVx_DetectContTone(0.1,200,1,512,1,3)
% [T,F,B] = LVx_DetectContTone(0.08,500,0,512,1,3)
% [T,F,B] = LVx_DetectContTone(0.02,500,1,512,1,1)
% [T,F,B] = LVx_DetectContTone(0.018,500,1,512,1,2)
% [T,F,B] = LVx_DetectContTone(0.1,500,1,512,1,3)
% [T,F,B] = LVx_DetectContTone(0.005,1000,0,512,0,1)
% [T,F,B] = LVx_DetectContTone(0.004,1000,0,512,1,1)
% [T,F,B] = LVx_DetectContTone(0.002,3000,0,512,1,1)
Here is a suggested procedure to create the script described above:
(a) Open the audio file 'drwatsonSR8K.wav' , scale it to have maximum magnitude of 1.0, and add
a sinusoid of amplitude A and frequency Freq , thus forming the test signal TstSig .
(b) Form a matrix TDMat by partitioning TstSig into frames of length SR , with overlap of SR/ 2
samples ( SR must be even). Each column of the matrix TDMat will be a frame. For example, if the audio
file were 32 samples long, and the frame size were 8 samples, then the first column of the matrix will
comprise samples 1:8, the second column will be samples 5:12, the third column will be samples 9:16,
and so forth, until all 32 samples have been used. If the last column is only partially filled with samples,
it is completed with zeros. A good way to proceed is to make this action a function according to the
following specification:
function OutMat = LVxVector2FramesInMatrix(Sig,SzWin,...
SampsOvrLap)
% Divides an input signal vector Sig into frames of length
% SzWin, with an amount of overlap in samples equal to
% SampsOvrLap. Each column of OutMat is one frame
% of the input Sig.
% Test calls:
% OutMat = LVxVector2FramesInMatrix([0:1:33],8,4)
% OutMat = LVxVector2FramesInMatrix([0:1:33],8,0)
% OutMat = LVxVector2FramesInMatrix([0:1:33],8,1)
% OutMat = LVxVector2FramesInMatrix([0:1:33],8,2)
(c) If 50% overlap has been used, window each column of TDMat with a suitable window such
as hamming, etc. When not using overlap, application of a window results in noticeable amplitude
modulation of the output signal reconstructed from the windowed frames, so a nonrectangular window
should not be applied to the columns (frames) of TDMat in such a case.
(d) Compute a matrix Fty which is the DFT of TDMat , computed using the function ff t .If
no overlap was used and hence no nonrectangular window applied to the frames of TDMat , apply a
Search WWH ::




Custom Search