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

17 ビュー (過去 30 日間)
Saravanakumar Chandrasekaran
Saravanakumar Chandrasekaran 2021 年 6 月 13 日
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
X=Y.*H;
xchk = ifft(X);
x=real(ifft(X, Lx2)); % Inverse fast Fourier transform
x1=x(1:1:Lx);
sound(x1,Fs);

回答 (0 件)

カテゴリ

Help Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by