Matlab function (M-File) that will create & play a sinusoidal waveform

  • Thread starter makovx
  • Start date
  • #1
23
0
I am trying to create a matlab function (M-File) that will create & play a sinusoidal waveform with the given amplitude (A), frequency (f), sampling rate (Fs), and time span (tspan). the function must produce a .wav file with a specified filename.

the matlab Function Format must be:

function mytone(A,f,Fs,tspan,filename)

I have a sample problem:
the command mytone(0.4,300,8000,3,'threehundred.wav') creates and plays a sinusoid x(t)=0.4sin(2*pi*300t) for 3 secs. the sampling rate is 8000 Hz. the resulting tone is saved with a filename threehundred.wav.

after executing the command, you must hear a low frequency tone similar to the dial tone of telephone.


I am really a newbie in using MATLAB. I hope somebody can help me.
 

Answers and Replies

Related Threads on Matlab function (M-File) that will create & play a sinusoidal waveform

Replies
6
Views
7K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
7
Views
1K
Replies
0
Views
1K
Replies
16
Views
307
Replies
0
Views
3K
  • Last Post
Replies
9
Views
3K
Replies
1
Views
1K
Replies
1
Views
4K
Top