Performing convolution – 3 signals are convolving with three corresponding signal ?
I have attached the data and facing a following problem.
In a first step I am convolving a wav (101 1) with trc (101 3) e.g., a single wav is being convolved three trc (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 attaced all the three wav (wav_near, wav_mid, wav_far) and trc. I tried a lot of combinations but 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);
endI have attached the data and facing a following problem.
In a first step I am convolving a wav (101 1) with trc (101 3) e.g., a single wav is being convolved three trc (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 attaced all the three wav (wav_near, wav_mid, wav_far) and trc. I tried a lot of combinations but 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 I have attached the data and facing a following problem.
In a first step I am convolving a wav (101 1) with trc (101 3) e.g., a single wav is being convolved three trc (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 attaced all the three wav (wav_near, wav_mid, wav_far) and trc. I tried a lot of combinations but 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 matlab code, matlab, matrices MATLAB Answers — New Questions