Digital Signal Processing Reference
In-Depth Information
% LV_InterpolationViaSinc(1000,100,1)
% LV_InterpolationViaSinc(1000,50,1)
% LV_InterpolationViaSinc(1000,25,1)
% LV_InterpolationViaSinc(5000,100,1)
16. Write the m-code for the script
LV xSineROMNonIntDecInterp(N,F _ ROM, D)
as described and illustrated in the text. Test the script with the following calls:
(a) LVxSineROMNonIntDecInterp(77,1,7.7)
(b) LVxSineROMNonIntDecInterp(23,2.5,0.6)
(c) LVxSineROMNonIntDecInterp(48,3,4)
17. A chirped audio signal which is of one second duration and which sweeps from 0 Hz to 8000
Hz in one second is sampled at 2000 Hz. Compute and plot the resultant wave State at what times
during the one second interval maxima and minima in observed (or audible or apparent) frequency occur.
18. Write the m-code for the following function, which uses sinc interpolation to convert an audio
file sampled at 8 kHz to one sampled at 11.025 kHz.
function LVxInterp8Kto11025(testSigType,tsFreq)
% Converts an audio signal having a sample rate of 8 kHz to
% one sampled at 11.025 kHz using both sinc and linear
% interpolation. The audio files used can be either the audio
% file 'drwatsonSR8K.wav' or a cosine of user designated
% frequency. For sinc interpolation it uses 10 samples of the
% input signal and a 100 by 10 sinc interpolation matrix to
% generate sample values located at the fractional sample
% index values 1:320/441:length(OriginalAudioFile)
% To use 'drwatsonSR8K.wav', pass testSigType as 1 and
% tsFreq as [] or any number; to use a cosine, pass
% testSigType as 0 and pass tsFreq as the desired cosine
% frequency in Hz. The script automatically plays the original,
% sinc-interpolated, and linear interpolated signals using the
% Mathscript function sound., and plots, for a short sample
% interval, the original, sinc-interpolated, and linear interpolated
% signal values on one axis for comparison prior to
% post-interpolation lowpass filtering, which limits the
% passband of the interpolated signals to the original 4 kHz
% bandwidth.
% Test calls:
% LVxInterp8Kto11025(0,250)
% LVxInterp8Kto11025(0,2450)
% LVxInterp8Kto11025(1,[])
The sinc interpolation matrix may, for example, consist of rows 900-999 as seen in Fig. 3.31. As
an example computation, if (say) a sample is needed at index 10.71, the ten columns of row 72 (the row
index must start with one rather than zero) of the sinc matrix would be multiplied by original signal
samples 6-15, respectively, with sample 10 (i.e., floor(10.71) ) being multiplied by column 5 as shown in
Fig. 3.31, and sample 11 (i.e., ceil(10.71) ) being multiplied by column 6. The products are summed to
Search WWH ::




Custom Search