0% found this document useful (0 votes)
64 views1 page

Echo Generator

This MATLAB function takes an audio input signal, samples the signal to add an echo at a specified delay and amplitude. It creates an echo signal by copying the input values to an extended array, scales the combined signal if it exceeds the maximum amplitude, and returns the final output signal with added echo.

Uploaded by

ramanaidu1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views1 page

Echo Generator

This MATLAB function takes an audio input signal, samples the signal to add an echo at a specified delay and amplitude. It creates an echo signal by copying the input values to an extended array, scales the combined signal if it exceeds the maximum amplitude, and returns the final output signal with added echo.

Uploaded by

ramanaidu1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

function [output]= echo_gen(input,fs,delay,amp)

[r,c] = size(input);
extraEchoTime = round(delay*fs);
echoSignal = zeros(r+extraEchoTime,1);
addEchoSignal = echoSignal ;
for i=1:r
echoSignal(extraEchoTime+i,1) =input(i,1)*amp ;
addEchoSignal(i) = input(i);
end
addEchoSignal = addEchoSignal + echoSignal ;
range = abs(addEchoSignal) ;
maxrange = max(range);
if maxrange>1
addEchoSignal = addEchoSignal/maxrange;
end
output = addEchoSignal ;
end

You might also like