Multiply sound by pulse
Mostrar comentarios más antiguos
How do I make a pulse and make the time of the pulse match the audio file time? For the pulse I would like the period to be 2 seconds, and amp of 1, and a duty cycle of 50%. I would then like to multiply the pulse by the audio file.
1 comentario
Image Analyst
el 30 de Mzo. de 2020
You shouldn't have completely replaced your original question with a new question. Now our answers below don't make much sense anymore. Anyway, you can see in my answer where I compute the audioTime. If your pulse (both 1 and 0 parts) was the length of that file, then you can't have a period of 2 seconds (unless the audio time was 2 seconds also).
Respuesta aceptada
Más respuestas (1)
Ameer Hamza
el 29 de Mzo. de 2020
Try this
load handel.mat
sound(y, Fs); % original sound
pause(9)
time_tot = numel(y)/Fs;
mod_signal = gensig('square', 1, time_tot-1/Fs, 1/Fs);
mod_sound = y.*mod_signal;
sound(mod_sound, Fs); % modulated sound
Categorías
Más información sobre Simulation, Tuning, and Visualization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
