필터 지우기
필터 지우기

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

조회 수: 8 (최근 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 CenterFile Exchange에서 Discrete 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