Convolution Reverb | MATLAB code

Опубликовано: 27 Июль 2026
на канале: Hi Tech TIPs
3,501
38

https://www.udemy.com/course/master-i... Code is for sale: worth 25$, contact me @
https://wa.me/+923400151346
[email protected] Fiverr contact:
https://www.fiverr.com/share/p07G38
https://www.fiverr.com/share/lla0dR
https://www.fiverr.com/share/9bVRwd
https://www.fiverr.com/share/VNxpbB
https://www.fiverr.com/share/aprvdg
https://www.fiverr.com/share/108Q26 Topics Covered:

1. audio signal processing
2. Audio Signal Processing in MATLAB
3. image processing
4. image processing using matlab
5. arm assembly language tutorial
6. Convolution in MATLAB
7. How to Perform Convolution in MATLAB
8. conv in MATLAB
9. How to convolve two signals in MATLAB
10. convolve to signals in MATLAB
11. matlab basics
12. matlab convulation,matlab linear convolution
13. matlab code for linear convolution
14. convolution integral matlab
15. convolution in matlab code
16. convolution signals and systems

Email : [email protected]
Fivver : https://www.fiverr.com/s2/e28b146f01
Udemy : https://www.udemy.com/course/2020-com...
ResearchGate: https://www.researchgate.net/profile/...
Facebook :   / fawad.gul.58  


clear all
%% ~~~ Read the provided input .wav file
%-----------------------------------------------------
[Input_wav,Sample_Frequency] = audioread('Input.wav');
Input_wav = Input_wav./max(abs(Input_wav));
% ~~~ Play the input .wav ~~~~
soundsc(Input_wav,Sample_Frequency)
Input_Length = size(Input_wav,1);
Playbacktime = Input_Length/Sample_Frequency;
pause(Playbacktime) % Pause further coding for the duration
%-----------------------------------------------------


%% ~~~ Convolution Reverberator ~~~~
%------------------------------------------------------
%~~~ Input Impulse response
disp(' Enter the impulse time Impulse time(second)')
Impulse_position(1) = input('');
disp(' Enter the impulse Amplitude')
Impulse_position(2) = input('');

%- Generate the impulse Response
Imp_response = zeros(size(Input_wav,1),1);%Impulse

% Generate impulse train

Imp_response(Impulse_position(1)*Sample_Frequency) = Impulse_position(2);


% plot the input waveform
subplot(2,1,1);
hold on
plot((((1:Input_Length) -1)/Sample_Frequency),Input_wav,'b');
xlabel('Time (seconds)')
ylabel('Amplitude')


%--------- Convolution operation------------------------------
Reverber_length = length(Input_wav) + length(Imp_response) - 1;
F_input = fft(Input_wav, Reverber_length) ;
F_impluse = fft(Imp_response, Reverber_length);
Output_wav = ifft(F_input.*F_impluse);
Output_wav = Impulse_position(2).*(Output_wav./max(abs(Output_wav)));
%-------------------------------------------------------------
% plot the Reverberator waveform

plot( (((1:size(Output_wav,1))-1)/Sample_Frequency),Output_wav,'r');
title('Reverberated Signals')

subplot(2,1,2);
plot((((1:Input_Length) -1)/Sample_Frequency),Imp_response,'m');
xlabel('Time')
ylabel('Amplitude')
title('Impulse Response');

%% ------- play and Write a .wav file-----------------
Output_wav(1:Input_Length) = Output_wav(1:Input_Length) + Input_wav(1:Input_Length);
sound(Output_wav,Sample_Frequency)
audiowrite('output.wav',Output_wav,Sample_Frequency);