Estudio y gráfico de una señal de audio en matlab

Páginas: 5 (1159 palabras) Publicado: 5 de mayo de 2011
The following code is used In order to work with an audio signal in Matlab and plot
the graph of its amplitude over time.
[sig,fs,bits,opt]=wavread('piano_A.wav');
Ts=1/fs;
len = length(sig);
Dur = len/fs;
Time=0:Ts:(Dur-Ts) ;
plot(Time,sig);



In this case the graph shows the characteristics of a piano string vibrating over time.
The intensity or the amplitude of eachvibration decays over time untill it stops . At around 7 seconds.
The next diagram shows the Frequency response of the same signal . In this graph it
is possible to see the different harmonics that makes this particular sound different
from the rest.
The harmonic of its natural frequency (440Hz for an A note) produces several
harmonics that are multiples of the 440 Hz Frequency such as 880Hz,1760Hz and
so on. This graphs show that this piano string vibrating makes over 10 different
harmonics which makes it sound in this particular way.
.
Frequency response of Piano A sound.
The multiples of the natural frequency as well as the natural frequency itself do not
match exactly with the theorycal values.This is due to the tension of the string. This
is one of the reason whythe exact timbre of a piano can not be emulated digitally as
this harmonics have got a different amplitude over time depending on the way the
note has been played.

The code for this harmonics as pure tones in matlab is as following:
sig2 = A*sin(2*pi*f2*t); sig3 = A*sin(2*pi*f3*t);
sig4 = A*sin(2*pi*f4*t);sig5 = A*sin(2*pi*f5*t);
tone = sig1+sig2+sig3+sig4+sig5;
tone =tone./max(tone);
sound (tone, fs);
Matlab also allows us to plot the time domain envelope of the signal to extract
information such as Attack, Decay, Sustain and release of a signal . This parameters
can also be modified by using the following code :
A = logspace(0, 1, fs);
D = logspace(1, 0.8, fs);
S = logspace(0.8, 0.8, fs);
R = logspace(0.5, 0, fs);
ADSR= [A D S R];
env = [A D S R];
plot(env);
In this case the type of function used for the envelope has been logspace which
creates a Logaritmic type of curve.


The same process is following to amplitude of the signal in matlab for the sound
Piano middle C note.
The resulting graph is the following :

This graphs shows a smaller amplitude compared to the previous sound. It also
shows how this sample lasts lesstime than the previous one.
Regarding the frequency response of this sample, the graph shows that this one has
over 10 different harmonics as well as the previous piano note . This graphs shows
bigger amplitude for higher frequencies where as piano A did not


The parameters for the envelope in this sound have also been modified by using the code:
A = logspace(0, 1, fs)
D =logspace(1, 0.6, fs);
S = logspace(0.6, 0.6, fs);
R = logspace(0.6, 0, fs);
ADSR= [A D S R];
env = [A D S R];
plot (env);
The resulting plot is the following


It shows the new Attack, Decay, Sustain and release.
Chirp signals have got several aplications within comunication systems. They are
commonly used in radars due to its durability.
However, in this exercise a chirp signal is goingto be generated from the quadratic
function at*t+bt+c .The code use to generate the signal, plot it and play the resultant
sound is :


The frequency of the signal as well as the duration of it can be modified by changing
the values of the variables that define these parameters such as f1,f2 or t.
The signal is plotted by using plot function and player with sound function so it ispossible to listen and notice the difference between sound when changing the values
of the variables. To understand how the variables in the cuadratic function can
correspond to the different variables in the function it is necessary to understand how
Calculate its first derivate.
f= at*t+bt+c
f’= 2at+b
And then e’=w=2at+b;w0=b and therefore b=f1
So if e=2*a*t=f1
F2=2*a*t+f1...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Graficador de señales discretas en MatLab
  • Gráfica de señales en matlab
  • Señales Matlab
  • Procesamiento de señales de audio por medio de matlab
  • Procesamiento de señales de audio por medio de matlab
  • Señales En Matlab
  • Señales en matlab
  • Grafica en matlab

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS