Multiply sound by pulse
Afficher commentaires plus anciens
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 commentaire
Image Analyst
le 30 Mar 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).
Réponse acceptée
Plus de réponses (1)
Ameer Hamza
le 29 Mar 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
Catégories
En savoir plus sur Audio I/O and Waveform Generation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
