Info
This question is closed. Reopen it to edit or answer.
regarding parfor and brange
1 view (last 30 days)
Show older comments
actually i am working on convolution of an 1D signal all the inputs and outputs are vectors of sizes typically (1,15million) and conv is predefined function in matlab and gaussian filter is an 1d gaussian signal of length (1,100). my code is something like this
for i=1:20
a=conv(input_signal_1,gaussian_filter,'same')
b=conv(input_signal_2,gaussian_filter,'same')
c=conv(input_signal_1.*cos(2i-10),gaussian_filter,'same')
d=conv(input_signal_2.*sin(2i-10),gaussian_filter,'same')
output_1=output_1+(cos(2i-10).*c +sin(2i-10).*d)
end
the time taken for the above task is about 20 seconds with parfor its becoming even more worst even after creating a pool of 4 workers its actually taking 200 seconds with drange time is around 19 seconds actually i want to decrease the time to around 5 seconds how can i do it with parallel computation toolbox my pc is an quadcore i7 2.2 Ghz and has 8gb of ram have matlab 2012b
2 Comments
Matt J
on 14 Jun 2014
You don't use the loop variable i anywhere in your example code, so it's hard to see what's supposed to be i-dependent. Is cos(2i-10) supposed to be cos(2*i-10)?
We also can't see what inputs get created on the client and what gets created inside the loop.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!