How to speed up convolution with a million data points
Show older comments
I am currently doing convolution using nested for loops, for 10^6 data points in each for loop. Are there ways to speed up the following code? Thanks in advance!
% nIters = 40;
% n = 1e6;
% mzL = rand(nIters, n);
% gg = rand(1, n);
mzR_temp = zeros(nIters, 1);
for c = 1:n
mzR_temp(:) = 0;
for d = 1:c
mzR_temp(:) = mzR_temp(:) + gg(c-d+1) * mzL(:,d);
end
mzR_II(:,c) = mzR_temp;
end
Accepted Answer
More Answers (1)
Image Analyst
on 3 May 2024
1 vote
Categories
Find more on Correlation and Convolution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
