DSPRelated.com
Forums

Basics of DSP

Started by maxroucool November 3, 2009
Hi,

I am new on this website, in DSP, and almost in Matlab :)

I have to do a project about audio signal processing. Form the moment
our subject is not so precise, we have first to get familiar with
principal DSP tools, and then we will try to find a interesting subject.
We are thinking about subjects like basics speaker/speech recognition,
analyze of the differences between male and female voices, or a little
program able to write the drums tab of a music... If you have
interesting ideas, don't hesitate ;)

So for the moment, I tried to get used to DSP tools (Import an audio
file and draw it, reduction of the noise, spectrum analyze), and to
program them by myself. So here is the result. I would like to know if
it good or bad, or if I should use others methods.

file1 = 'MTTomHigh';

% Draw the profile of the audio file
[y1, Fs1] = wavread(file1); % Import the audio file [data,
Sampling Frequency]
L1 = length(y1); % Number of elements
t1 = (1:L1)/Fs1; % Time scale

figure(1) % Draw the signal
subplot(2,1,1)
plot(t1,y1)
title(['Waveform of ' file1])

% Noise suppression
y1_denoised = wden(y1,'heursure','s','one',5,'sym8'); % Generate the
de-noised signal
figure(1)
subplot(2,1,2)
plot(t1(1:end), real(y1_denoised(1:L1))) % Draw the
de-noised signal
% Draw the spectrogram of noisy signal
NFFT1 = 2^nextpow2(L1); % Next power of 2 from length of
y
Y1 = fft(y1,NFFT1)/L1; % Generate the FFT of the signal
f1 = Fs1/2*linspace(0,1,NFFT1/2+1);

% Plot single-sided amplitude spectrum.
figure(2)
subplot(2,1,1)
plot(f1(1:5000),2*abs(Y1(1:5000))) %plot(f1,2*abs(Y1(1:NFFT1/2+1)))
title('Single-Sided Amplitude Spectrum of y1(t)')
xlabel('Frequency (Hz)')
ylabel('|Y1(f)|')

% Draw the spectrogram of denoised signal
Y1_denoised = fft(y1_denoised,NFFT1)/L1;

% Plot single-sided amplitude spectrum.
figure(2)
subplot(2,1,2)
plot(f1(1:5000),2*abs(Y1_denoised(1:5000)))
title('Single-Sided Amplitude Spectrum of y1_denoised(t)')
xlabel('Frequency (Hz)')
ylabel('|Y1_denoised(f)|')

% Play the noisy and denoised signals
wavplay(y1, Fs1)
wavplay(real(y1_denoised),Fs1)

Also, I would like to know, why does the FFT is divided by L1, the
number of elements composing the signal? Is it something like a
normalization? (It is a code that I found in MatLab help)
Thank you very much!

Max
+++