Professional Documents
Culture Documents
Dsplab2 PDF
Dsplab2 PDF
Dsplab2 PDF
Create a MATLAB function that records voice (“light” and “dark”) from microphone with
sampling frequency, saves as hello.wav and olleh.wav files in current directory. Also introduce a
pause in between the two records.
Solution:
%Fs=sampling frequency
Lab Report Question: What is the effect of changing sampling frequency of writing
(i.e. in wavwrite function) at 2,000 (or 2 KHz) and at 12,000 (12 KHz) if recording was
done at 6KHz? Where is conversion of continuous to digital signal happening? How can
you relate downsampling/upsampling to the above example?
Application of “Correlation” in voice signal:
Theoretical Background: In signal processing, cross-correlation is a measure of
similarity of two series as a function of the displacement of one relative to the other.
The cross-correlation between two signals x(n) and y(n) is
For, continuous time signal, the summation should be replaced as an integration and
signals should be represented as x(t) and y(t).
Cross correlation is used to find where two signals match:
u(t) is the test waveform. v(t) contains u(t) with an unknown delay and added noise.
If we slide the v(t) signal along u(t) and find the correlation according to the formula, we can know how
much the signals match. Also, how much displacements are between the signals.
Px = Ex / length (n) %Note Ex has to be only for the index n not infinite sum