Multichannel signal filter with multichannel impulse response (efficiently)
이전 댓글 표시
Objective:
Filter 16-channel audio files with corresponding 16-channel impulse response (IR) data (obtained using MATLAB IR measurer app and stored as .mat file in the default format) efficiently. Each channel is filtered independently by one IR only, on a 1-1 (...16-16) basis.
Tried:
Running this in a nested loop works, but is relatively slow for filtering lots of audio files. Simple example:
% load impulse responses (format is according to MATLAB app output)
load("measured_ir_data.mat")
% get audio render filenames (filepath variable is the system path to the
% input audio files)
filelist = string({dir(fullfile(filepath ,"*.wav")).name}.');
% loop over files and filter with each IR
for ii = length(filelist):-1:1
filename = filelist(ii);
[inAudio, sampleRate] = audioread(filename);
% loop over channels
for jj = size(inAudio, 2):-1:1
filtAudio(:, jj) = filter(measurementData.ImpulseResponse(jj).Amplitude,...
1, inAudio(:, jj), [], 1);
end
% the filtered audio is then further processed and written to file on
% each loop iteration
end
Perhaps this could be done more efficiently using a dsp.frequencydomainfirfilter-system-object? But that seems to want to filter each input channel with every filter, which is not what is needed here.
Perhaps there is another, more efficient approach using filtering, that does not involve resorting to matrix convolution?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Multirate and Multistage Filters에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!