Digital Signal Processing Reference
In-Depth Information
If the purpose is frequency analysis only, nonoverlapping frames can be used. Overlap in framing
a signal is used in filtering or compression techniques which result in reconstructed frames that are not
perfect reconstructions of the original frames, such as with lossy compression techniques like MP3. When
the reconstruction is perfect, nonoverlap of frames works well. When the reconstruction is lossy, 50%
overlap of windowed frames is useful because it serves as a crossfading operation (i.e., a smooth transition
from one frame to the next, in which the volume of one frame gradually fades while that of the other
gradually increases) that hides the discontinuities at frame boundaries, which can cause audible clicks or
other artifacts. When using 50% frame overlap, use of a nonrectangular window is essential to perform
the crossfading operation. Use of 50% overlap also increases the number of “snapshots” of the frequency
content per second, i.e., a finer-grained spectrogram.
We now present the script format, argument description, and test calls, followed by a procedure to
write the m-code for it.
function [ToneFreq,Fnyq,BnSp] = LVx_DetectContTone(A,...
Freq,RorSS,SzWin,OvrLap,AudSig)
% Mixes a tone of amplitude A and frequency Freq with an
% audio file and attempts to identify the frequency of the
% interfering tone, which may have a steady-state amplitude
% A when RorSS is passed as 0, or an amplitude that
% linearly ramps from 0 to A over the length of the
% audio file when RorSS is passed as 1. The audio file
% is 'drwatsonSR8K.wav', 'whoknowsSR8k.wav', or white
% noise, which are selected, respectively, by passing
% AudSig as 1, 2, or 3. SzWin is the size of time window in
% samples into which the test signal (audio file plus tone) is
% partitioned for analysis. In partitioning the test signal into
% time windows or frames, an overlap of 0% or 50% of
% SzWin is performed when OvrLap is passed as 0 and 1,
% respectively. A number of figures are created, including
% a first figure displaying mean bin magnitude of all bins
% for each frame, which serves to identify periods of high
% and low energy in the signal, corresponding to active
% speech and background sound, second and third figures
% that are 3-D spectrogram plots of DF T magnitude versus
% Bin and Frame for the complete signal and a version
% based on only the background or relatively low energy
% frames. Fourth and fifth figures display the normalized
% bin derivatives versus frame for the complete signal and
% the low portion of the signal.
% The output arguments consist of a list of possible
% interfering (relatively steady-state) tones in Hz as T, the
% Nyquist rate as F, and the bin spacing in Hz as B, which
% allows another program to determine if a list of frequencies
% provided as ToneFreq contains adjacent bin frequencies
% and are therefore likely to be members of the same spectral
% component.
% Test calls
Search WWH ::




Custom Search