How to create a rectangular pulse in time

I am trying to create a rectangular pulse to use an ideal low pass filter. I am going to multiply a function in the frequency domain by a pulse going up to 1 at 0, and ending at 10,000. I have tried using the rectpulse and rectangular pulse functions but have been unable to succescfully implement the pulse as a function of time. Could someone show me how to do this please?

 Respuesta aceptada

Image Analyst
Image Analyst el 30 de Jul. de 2017
Lets say your audio spectrum is 20,000 elements long. You can make a pulse like this.
bandPassSignal = zeros(1, length(1, audioSpectrum)); % Initialize to all zeros.
bandPassSignal(1:10000) = 1; % First 10,000 elements are now 1.
% Now multiply by the spectrum of your audio signal:
filteredAudioSpectrum = audioSpectrum .* bandPassSignal;
% Now inverse fft and listen to the sound.
filteredTimeDomainSignal = ifft(filteredAudioSpectrum);
player = audioplayer(y, filteredTimeDomainSignal);
play(player);

Más respuestas (0)

Categorías

Más información sobre Audio Processing Algorithm Design en Centro de ayuda y File Exchange.

Preguntada:

el 28 de Jul. de 2017

Comentada:

el 2 de Ag. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by