Performing convolution - 3 signals are convolving with three corresponding signal ?
조회 수: 3 (최근 30일)
이전 댓글 표시
I have attached the data and facing a following problem.
In a first step I am convolving a wav (101 x 1) with trc (101 x 3) e.g., a single wav is being convolved three trc vectors (of equal number of rows) and giving three outputs. I am using following code and it is working:
synth = conv2(wav_near', trc);
t0_i = floor(t0/dt); Nl = 101;
synth = synth(1+t0_i:Nl+t0_i,:);
Now, I have three wav (108 3) and want to convolve with trc (120 3) in way like the first wav will convolve with first trc, second wav with second trc and so on. I have attached all the three wav (wav_near, wav_mid, wav_far) and trc. I tried a lot of combinations but they are not working. How can I change the above code in this case?
The size of outcomes should be the size of trc.
One way I tried like but results are not same
synth = zeros(120, 3);
% Loop through each column
for col = 1:3
conv_result = conv2(wav(:, col), trc(:, col), 'full')
start_idx = floor((length(wav(:, col)) - 1) / 2) + 1;
end_idx = start_idx + 120 - 1;
synth(:, col) = conv_result(start_idx:end_idx);
end
댓글 수: 0
답변 (2개)
Image Analyst
2024년 6월 23일
The result of a normal, full convolution is the sum of the extents of the two waveforms. You can automatically crop to the length of the first argument (vector) if you use the 'same' option. This is usually used when the first vector is a long signal, and the second vector is a short vector that is the filter window.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Instrument Control Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!