Convolution of Audio Signals

조회 수: 22 (최근 30일)
Shubhra Sinha
Shubhra Sinha 2020년 4월 23일
댓글: Walter Roberson 2021년 12월 21일
I'm trying to convolve audio signal with impulse response but every time it's giving error as "A & A must be in vector forms"
[sig1, fs] = audioread('mysong1.wav'); % import the song
t = [1:length(sig1)]/fs;
subplot(3,1,1)
plot(t, sig1) % plot the song
xlabel('t (second)')
ylabel('Relative signal strength')
title('Song')
[sig2, fs] = audioread('StNCh.wav'); % import the song
t1 = [1:length(sig2)]/fs;
subplot(3, 1, 2)
plot(t1, sig2) % plot the song
xlabel('t1 (second)')
ylabel('Relative signal strength')
title('Impulse Response')
w = conv(sig1,sig2);
t2 = 0:1:10;
subplot(3,1,3);
plot(t2,w);
xlabel('t2 (second)')
ylabel('Relative signal strength')
title('Convolved Signal')
Please help me to figure out this.
  댓글 수: 5
Shubhra Sinha
Shubhra Sinha 2020년 4월 23일
Okay, Thank you Walter...
Ricardo Reyes
Ricardo Reyes 2020년 10월 13일
do you have the code fixed up?

댓글을 달려면 로그인하십시오.

채택된 답변

Michael Ndungi
Michael Ndungi 2021년 6월 8일
[sig1, fs] = audioread('mysong1.wav'); % import the song
t = [1:length(sig1)]/fs;
subplot(3,1,1)
plot(t, sig1) % plot the song
xlabel('t (second)')
ylabel('Relative signal strength')
title('Song')
[sig2, fs] = audioread('StNCh.wav'); % import the song
t1 = [1:length(sig2)]/fs;
subplot(3, 1, 2)
plot(t1, sig2) % plot the song
xlabel('t1 (second)')
ylabel('Relative signal strength')
title('Impulse Response')
w = conv(sig1,sig2);
t2 = 0:1:10;
subplot(3,1,3);
plot(t2,w);
xlabel('t2 (second)')
ylabel('Relative signal strength')
title('Convolved Signal')
  댓글 수: 3
Nurafiqah Mukhtar
Nurafiqah Mukhtar 2021년 12월 21일
i cant use this coding.. may i know why?
wave convolution not came out.
Walter Roberson
Walter Roberson 2021년 12월 21일
I described some reasons in the comments I posted earlier.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by