dimanche 1 février 2015

Nyquist theorem in matlab


Vote count:

0




Im trying to make a small script in matlab, so i can hear both the analog and digital sin waves , the idea is to be able to change Tm that is the sampling rate, by changing Tm i should be able to hear the digital sound at the sampling frequency i chooose


However im stuck with this the stem function, since i havent been able to change the sample rate in the stem function, hopefully someone here can lend me a hand



clf
t=0:1:17.7
y=sin(2*pi*0.06*t) %l von Vp de 2.5v

plot(t,y) %Entry signal
hold on
plot(t,y,'ko') %Output graph
stem(t,y)
hold off

n=[0:1:10000] %Duration of tone

ftono=440 %sound frequency
fm=8000 %frecuency sample rate
Tm=1/fm %sampling period

A=1

x=A*sin(2*pi*ftono*Tm*n) %Sin wave using sam,pling period

sound(x,fm) %Analogic sound


asked 2 mins ago







Nyquist theorem in matlab

Aucun commentaire:

Enregistrer un commentaire