Convolution of two .wav files and deconvolve to get back original

9 views (last 30 days)
i have convolved two audio files in .WAV format (y1 and y2) to compute y3. Now i would like to de convolve ( i mean i m trying to get back the audio y2 from y3). I didnt get the same value(y2 is not equal to x1). How to get the same values. The code is given below. i have attached the audio files also.
clear all;
close all;
% Fs = 8000;
[y1,Fs] = audioread('modern.wav');
% sound(y1,Fs);
[y2,Fs] = audioread('second.wav');
% sound(y2,Fs);
%Perform Convolution
y3 = conv(y1,y2);
% sound(y3,Fs);
%Perform De convolution to get back y2
Lx=length(y3)-length(y1)+1; %
Lx2=pow2(nextpow2(Lx)); % Find smallest power of 2 that is > Lx
Y=fft(y3, Lx2); % Fast Fourier transform
H=fft(y1, Lx2); % Fast Fourier transform
xchk = ifft(X);
x=real(ifft(X, Lx2)); % Inverse fast Fourier transform

Answers (0)


Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by