mixing audios according to array value
Show older comments
hi i have the following code which mixes two audios and plots them :
Fs = 44100;
[y,Fs] = audioread("sound and 1000 new.wav");
[x,Fs] = audioread("160 hz.wav");
mix = y+x;
sound(mix,Fs)
Nsamps = length(mix);
t = (1/Fs)*(1:Nsamps)
y_fft = abs(fft(mix));
y_fft = y_fft(1:Nsamps/2);
f = Fs*(0:Nsamps/2-1)/Nsamps;
figure
plot(f, y_fft)
xlim([0 5000])
xlabel('Frequency (Hz)')
ylabel('Amplitude')
the values of y and x are x = 192000 and y = 192000
now i create a simple sine tone by the following code:
Fs = 44100;
dt = 1/Fs;
StopTime = 3
t = (0:dt:StopTime-dt);
Fc = 1000;
A = 1;
z = A*sin(2*pi*Fc*t);
sound(z,Fs)
the value of z is
as we can see Z is different than X and Y although they are all 3 seconds so i cant mix them, how can i generate a simple sine tone with tha value of Z similar to X and Y so im able to mix them?
Accepted Answer
More Answers (0)
Categories
Find more on Simulation, Tuning, and Visualization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
