Re: Timing, Frequency synchronization using matlab
For more info type:
help sound
In the matlab command line.
Here's a fun program.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function musc_note()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Make a Musical tone. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tl=input('Enter length of tone (sec) ')
Fs=input('Enter the sample rate. (Max=1e5) ')
Tone=input('Enter the note. 50-18000 (in Hz)
t=0: (1/Fs) :tl; % 10 Seconds (time)
y=sin((Tone*t*(2*pi))); % sin is in rad's
sound(y,Fs);
plot(t,y)
yy=y.*(sin(Tone*.3*t*(2*pi)).^2);
display('Press sp-bar to hear w/Mod. ')
pause;
sound(yy,Fs);
plot(t,yy)
% display('Press sp-bar to hear in stereo. ')
% pause;
% z=cos((Tone*t*(2*pi))); % sin is in rad's
% stro=[y',z'];
% sound(stro,Fs);
Hope this helps