<
We know that MATLAB is a very useful software for analyzing waveforms, although its main purpose is not the same. Let me share you a little project of mine which I made as my semester project.
Wavefun! is a little application which has following features:
1.Record your sound
2.Plot the voice signal
3.Calculate fourier transform of the recorded sound signal
4.Plot the fourier transform of the signal hence the frequency response of the signal.
5.Listen to the sound signal as many times as necessary for the analysis.
6.Reverse play back option.
7.Plot the original signal as many times as necessary
8.Add echo to the recorded signal and listen to it.
1.Right click the recording button and click on view callbacks, click callback. following will appear:
WAVEFUN!
We know that MATLAB is a very useful software for analyzing waveforms, although its main purpose is not the same. Let me share you a little project of mine which I made as my semester project.
Wavefun! is a little application which has following features:
1.Record your sound
2.Plot the voice signal
3.Calculate fourier transform of the recorded sound signal
4.Plot the fourier transform of the signal hence the frequency response of the signal.
5.Listen to the sound signal as many times as necessary for the analysis.
6.Reverse play back option.
7.Plot the original signal as many times as necessary
8.Add echo to the recorded signal and listen to it.
HOW TO MAKE IT!
First open your matlab GUI and arrange the following items on the workspace:
- one axis
- 6 pushbuttons
- text boxes as you wish
After putting the desired things, mine looked like this:
Now from here begins the coding process:
Instead of global variable, m-file is made to access the same file by all pushbuttons.
CODING STEPS:
1.Right click the recording button and click on view callbacks, click callback. following will appear:
Now inside function definition; write the following code:
recObj = audiorecorder(8000, 16,1); % starts recording at 8kHZ with 16bits in single channel.
recordblocking(recObj,5);
myRecording = getaudiodata(recObj);
% Plot the samples.
wavwrite(myRecording,'my.wav');
plot(handles.axes1,myRecording);
Now similarly open the call backs of other push buttons and add the respective codes:
PLAY BUTTON:
[y Fs]=wavread('my.wav');
sound(y,8000);
PLOT FOURIER:
b=wavread('my.wav');
plot(handles.axes1,abs(fft(b)));% plots fourier of 20 sample after taking absolute.
REVERSE PLAYBACK BUTTON:
[y,Fs]=wavread('my.wav');
r=flipud(y);% inverts the signal upside down as signal is in the form of column
sound(r,Fs);% plays the inverted signal
PLOT THE ORIGINAL WAVE BUTTON:
c=wavread('my.wav');
plot(handles.axes1,c);
ADD ECHO BUTTON:
y = wavread('my.wav');
%code that adds echo
echo=y; % set up a new array, same size as old one
N=1000;
for i=1:1:2; % sets number of times the process below is repeated
n=N+1:length(y);% sets the length of n
echo(n)=y(n)+0.5*y(n-N); % adds etaneuated signal in the original signal
sound(echo,8000); % pays the echo added sound
end
Done!
For a guaranteed online earning experience I recommend freelancer.com , get registered for free and join me there now!
Now run your code either through GUI or m-file coding, and have fun+knowledge with this handy matlab app.
Now run your code either through GUI or m-file coding, and have fun+knowledge with this handy matlab app.
No comments:
Post a Comment