audio - how to combine different frequence into one .wav -
audio - how to combine different frequence into one .wav -
i want creat .wav 12khz 13khz matlab.i know how create single frequence,but idont know how combine them 1 file. there simple command?
class="lang-matlab prettyprint-override">fs =44100; tonefreq1 = 12000; nseconds = 25; f1 = sin(linspace(0, nseconds*tonefreq1*2*pi, round(nseconds*fs))); tonefreq2 = 12100; nseconds = 25; f2 = sin(linspace(0, nseconds*tonefreq2*2*pi, round(nseconds*fs))); tonefreq3 = 12200; nseconds = 25; f3 = sin(linspace(0, nseconds*tonefreq3*2*pi, round(nseconds*fs))); tonefreq4 = 12300; nseconds = 25; f4 = sin(linspace(0, nseconds*tonefreq4*2*pi, round(nseconds*fs))); tonefreq5 = 12400; nseconds = 25; f5 = sin(linspace(0, nseconds*tonefreq5*2*pi, round(nseconds*fs))); tonefreq6 = 12500; nseconds = 25; f6 = sin(linspace(0, nseconds*tonefreq6*2*pi, round(nseconds*fs))); tonefreq7 = 12600; nseconds = 25; f7 = sin(linspace(0, nseconds*tonefreq7*2*pi, round(nseconds*fs))); tonefreq8 = 12700; nseconds = 25; f8 = sin(linspace(0, nseconds*tonefreq8*2*pi, round(nseconds*fs))); tonefreq9 = 12800; nseconds = 25; f9 = sin(linspace(0, nseconds*tonefreq9*2*pi, round(nseconds*fs))); tonefreq10 = 12900; nseconds = 25; f10 = sin(linspace(0, nseconds*tonefreq10*2*pi, round(nseconds*fs))); f_12345678910= [f1+f2+f3+f4+f5+f6+f7+f8+f9+f10]; f_z=[f_12345678910]; sound(f_z,fs) wavwrite(f_z, fs, 24, '12_13zkhz.wav');
your info wavwrite needs in range of -1.0 1.0. can prepare dividing 10.
f_12345678910= [f1+f2+f3+f4+f5+f6+f7+f8+f9+f10]/10;
your sine wave generation more readable if generate time axis once.
t = [1:1:(fs*nseconds)]; f1 = sin(2*pi*t*tonefreq1/fs);
audio matlab-figure
Comments
Post a Comment