Matlab audio recording I am a little confused on this plot o
Matlab audio recording
I am a little confused on this plot of an audio recording I recorded using Matlab. The prompt said to read \"Hello, DSP is fun.\" Once recorded the plot came out like so:
Here is some additional info:
SampleRate: 8000
BitsPerSample: 16
NumberOfChannels: 2
DeviceID: -1
CurrentSample: 257
TotalSamples: 40000
Running: \'on\'
StartFcn: []
StopFcn: []
TimerFcn: []
TimerPeriod: 0.0500
Tag: \'\'
UserData: []
Type: \'audioplayer\'
So a few questions: Is the x-axis the samples? I am assuming so since the total samples is 40000. I know its not time. And what is the y-axis? frequency in Hz? If I wanted to convert the x-axis to time how would I do so? The sampling frequecy is 8000 Hz. The sampling interval is 1/Fs and T=n*Ts. So do I just multiply the sampling interval by 40000?
Help would be very appreciated! Thanks!
0.8 0.6 0.4 0.2 -0.2 -0.4 -0.6 -0.8 0.5 1.5 25 3.5 10Solution
i think may be you used this code
fs=8000; %sampling frequency 8000hz
T=1/fs; %sampling period
NS=0:1:40000; %number of samples are 40000
but may be u did not used the following line that is converting samples into real time
multiply each sample by sampling time period T
i.e.,
t=NS*T% for your the total time is 5 sec for 40000 samples at each sample 1.25e-4 sec
then plot(t,a) % where a is signal
the above solution gives direct result if all the sampling is done in matlab.
Otherwise if you are acquiring real world signal using some hardware then look into the workspace of matlab and seethat with what name data and number of samples are saved. Just convert the identified number of samples variable in to time using above mentioned logic.
And plot the signal using above command.
All the best....

