Feed on
Posts
Comments

save the following code to an m-file and run in matlab to generate some pure tones in wav format.

% pure tones

clear

freqs = 500;
duration = 100;

for i = 1:length(freqs)

sampleFreq = 44100;
dt = 1/sampleFreq;

t = [0:dt:duration];

s=sin(2*pi*freqs(i)*t);
sound(s,sampleFreq);
% wavName = sprintf(’tone%d.wav’,freqs(i));
% wavwrite(s,sampleFreq,16,wavName);

end


Bookmark and Share

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

One Response to “generate pure tones in matlab”

  1. on 22 Jan 2010 at 12:13 am shilpa

    Can u help in generating ctcss tones??
    please

Did I get this wrong? Let me know!

Trackback URI | Comments RSS

More blogs about http://desk.stinkpot.org:8080/tricks.