0% found this document useful (0 votes)
60 views42 pages

Ee338: Digital Signal Processing Computing Assignment # 2

The document describes two assignments for an digital signal processing computing course. Question 1 involves constructing an input signal comprised of two frequencies, plotting the DFT magnitude for different window and DFT sizes, and commenting on the results. Experimenting with rectangular and Hamming windows aims to find the analysis parameters that give the best estimates of the signal components using the shortest possible window duration. Question 2 provides audio samples of the sounds "aa" and "ee" spoken by several speakers and asks students to observe the waveforms and DFT spectra, commenting on similarities and differences. Students are then tasked with designing an elementary speech recognizer to distinguish the two phonemes based on their observations. The performance of the system is evaluated

Uploaded by

Sumit Gupta
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views42 pages

Ee338: Digital Signal Processing Computing Assignment # 2

The document describes two assignments for an digital signal processing computing course. Question 1 involves constructing an input signal comprised of two frequencies, plotting the DFT magnitude for different window and DFT sizes, and commenting on the results. Experimenting with rectangular and Hamming windows aims to find the analysis parameters that give the best estimates of the signal components using the shortest possible window duration. Question 2 provides audio samples of the sounds "aa" and "ee" spoken by several speakers and asks students to observe the waveforms and DFT spectra, commenting on similarities and differences. Students are then tasked with designing an elementary speech recognizer to distinguish the two phonemes based on their observations. The performance of the system is evaluated

Uploaded by

Sumit Gupta
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

EE338: DIGITAL SIGNAL PROCESSING COMPUTING ASSIGNMENT # 2

Question 1: Construct an input discrete-time signal x[n] comprised of 2 components of frequency and amplitude as specified: (f1=100/1024, a1=100.0) and (f2=105/1024, a2=10.0). Plot the DFT magnitude for different window and DFT sizes and comment on your results. Experiment with rectangular and Hamming windows. Find the analysis parameters that give you the best estimates of the signal components (keeping in mind that it is desirable to use the shortest window duration possible). Solution 1: Input Signal: x[n] = 100* sin(2*pi*(100/1024)*n) + 10* sin(2*pi*(105/1024)*n) for n= 0 to 1024 (Say) code: >> n= 0:1:500; >> y= 100* sin(2*pi*(100/1024)*n) + 10* sin(2*pi*(105/1024)*n); >> plot(n,y);

Window:

>> w = [ones(1,200),zeros(1,300)]; >> w.*y; >> c = w.*y; >> plot(c);

Window DFT spectrum:

Window length = 100;

Window= 50;

Window= 20;

Hamming:

Hamming window
The window is optimized to minimize the maximum (nearest) side lobe, giving it a height of about one-fifth that of the Hann window, a raised cosine with simpler coefficients .

Expression =
>> n= 0:1:500; >> y= 100* sin(2*pi*(100/1024)*n) + 10* sin(2*pi*(105/1024)*n); >> plot(n,y);

Hamming window of length = 200 >> w= hamming(200); >> plot(w);

Hamming window of length = 100 >> w= hamming(100); >> plot(w);

Hamming window of length = 50

>> w= hamming(50); >> plot(w);

Hamming window of length = 20 >> w= hamming(20); >> plot(w);

Question 2: You are provided recorded samples of the sounds aa and ee spoken by several different speakers. Observe the waveforms and DFT spectra and comment on the similarities and differences between samples. Based on your observations, design an elementary speech recognizer that can distinguish the 2 phonemes (aa & ee). Evaluate the performance of your system on the given data. Solution 2:

[y, Fs, bitrate]= wavread('aa1.wav'); sound(y,Fs,bitrate); time = ((1:length(y))/Fs); plot (time,y);

aa1.jpg DFT of aa1.jpg: >> dftaa1 = fft(y); >> plot (time,dftaa1);

2d person:
[y, Fs, bitrate]= wavread('aa2.wav'); sound(y,Fs,bitrate); time = ((1:length(y))/Fs); plot (time,y);

[y, Fs, bitrate]= wavread('ee2.wav');

sound(y,Fs,bitrate); time = ((1:length(y))/Fs); plot (time,y);

3rd person:
[y, Fs, bitrate]= wavread('aa3.wav'); sound(y,Fs,bitrate); time = ((1:length(y))/Fs); plot (time,y);

[y, Fs, bitrate]= wavread('ee3.wav');

sound(y,Fs,bitrate); time = ((1:length(y))/Fs); plot (time,y);

4th person:
[y, Fs, bitrate]= wavread('aa4.wav'); sound(y,Fs,bitrate); time = ((1:length(y))/Fs); plot (time,y);

[y, Fs, bitrate]= wavread('ee4.wav'); sound(y,Fs,bitrate); time = ((1:length(y))/Fs); plot (time,y);

5th person:
[y, Fs, bitrate]= wavread('aa5.wav'); sound(y,Fs,bitrate); time = ((1:length(y))/Fs); plot (time,y);

[y, Fs, bitrate]= wavread('ee5.wav');

sound(y,Fs,bitrate); time = ((1:length(y))/Fs); plot (time,y);

6th person:
[y, Fs, bitrate]= wavread('fa1.wav'); sound(y,Fs,bitrate); time = ((1:length(y))/Fs); plot (time,y);

[y, Fs, bitrate]= wavread('fee1.wav');

sound(y,Fs,bitrate); time = ((1:length(y))/Fs); plot (time,y);

Elementary speech recognizer that can distinguish the 2 phonemes (aa & ee).
Algorithm used to differentiate aa and ee, after observing the DFT graphs 1. First I have taken Discrete Fourier Transform of .wav sound data files of different speakers using the above mentioned MATLAB codes. 2. Then after taking Discrete Fourier Transform, I got an 1-D array corresponding to both sounds aa and ee of speaker X, whose magnitude I have stored in another array. 3. Then add the elements of the array into a final value say sumX, and sumY corresponding to both the samples respectively. 4. Now as I have observed the mean square distance from the origin is more in case of aa than ee in all the given samples of sound .wav files. 5. Comparing the mean square distance, we can differentiate the sounds aa and ee if we have the sample data values. This algorithm worked very well and was found to be correct for all the samples given to us.

Here is the check: >> close all; [x, Fs, bitrate]= wavread('aa1.wav'); time = ((1:length(x))/Fs); dx = fft(x); [y, Fs, bitrate]= wavread('ee1.wav'); time = ((1:length(y))/Fs); dy = fft(y); ax=abs(dx); ay=abs(dy); sumx= sum(ax); sumy= sum(ay); p = sumx-sumy; >> p p= 4.2145e+003

>> close all; [x, Fs, bitrate]= wavread('aa2.wav'); time = ((1:length(x))/Fs); dx = fft(x); [y, Fs, bitrate]= wavread('ee2.wav'); time = ((1:length(y))/Fs); dy = fft(y); ax=abs(dx); ay=abs(dy); sumx= sum(ax); sumy= sum(ay); p = sumx-sumy; >> p p= 2.9814e+003 >> close all; [x, Fs, bitrate]= wavread('aa3.wav'); time = ((1:length(x))/Fs); dx = fft(x); [y, Fs, bitrate]= wavread('ee3.wav'); time = ((1:length(y))/Fs); dy = fft(y); ax=abs(dx); ay=abs(dy); sumx= sum(ax); sumy= sum(ay); p = sumx-sumy; >> p p= 1.6418e+003

>> close all; [x, Fs, bitrate]= wavread('aa4.wav'); time = ((1:length(x))/Fs); dx = fft(x); [y, Fs, bitrate]= wavread('ee4.wav'); time = ((1:length(y))/Fs); dy = fft(y); ax=abs(dx); ay=abs(dy); sumx= sum(ax); sumy= sum(ay); p = sumx-sumy; >> p p= 4.0619e+003 >> close all; [x, Fs, bitrate]= wavread('aa5.wav'); time = ((1:length(x))/Fs); dx = fft(x); [y, Fs, bitrate]= wavread('ee5.wav'); time = ((1:length(y))/Fs); dy = fft(y); ax=abs(dx); ay=abs(dy); sumx= sum(ax); sumy= sum(ay); p = sumx-sumy; >> p p= 2.1465e+003

>> close all; [x, Fs, bitrate]= wavread('fa1.wav'); time = ((1:length(x))/Fs); dx = fft(x); [y, Fs, bitrate]= wavread('fee1.wav'); time = ((1:length(y))/Fs); dy = fft(y); ax=abs(dx); ay=abs(dy); sumx= sum(ax); sumy= sum(ay); p = sumx-sumy; >> p p= 2.6433e+003

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy