how to reduce a processing time in a FOR LOOP
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I have the following problem. I'm simulating a ODFM system that I must create a BERxSNR graphic using a for command . The problem is that I need to apply a viterbi algorithm two times inside this loop to estimate the signal. But this takes a long time to process (some times several days). I would like to have an option to reduce this time , below follows a very basic sample of the code
for isnr =2:1:30 (% SNR)
received signal to be analysed; %that is a [matrix 1 x (M x N)]
funtion viterbi 1 %( Its a loop point by point)
real(recived signal to be analysed)
output 1 ( [matrix 1 x (M/2 x N/2)]
funtion viterbi 2 ( Its a loop point by point)
imag(recived signal to be analysed)
output 2 ( [matrix 1 x (M/2 x N/2)]
data estimated=([output 1, output 2],MxN,1);% recompose the estimate data
end
[no_of_error(isnr),ratioisnr)]=biterr(data in , data_estimated)
2 comentarios
Walter Roberson
el 26 de Dic. de 2012
Are your two functions really defined inside the "for" loop ??
Your outline does not show "isnr" being used?
Jan
el 27 de Dic. de 2012
Does the profiler reveal, which lines require the most time? What are usual sizes of "M" and "N"?
It is most likely impossible to give a specific suggestion for an improvement based on an outlines code only. Posting the relevant (most time consuming) part of the real code would be more helpful.
Respuestas (0)
Ver también
Categorías
Más información sobre Error Detection and Correction en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!