Execution Timing Differences?
이전 댓글 표시
[MOVED THE Q? to BODY ... DPB]
If I run this code 10 time each time I got different execution time. I want it to take same time on every run. Also by changing fs from 100K to 1K execution time is of same order. Why it is not reducing for less samples? Please help.
clc; clear all; close all;
tic
fs=100000;
t=0:1/fs:0.1;
carrier=sin(2*pi*300*t);
messSign=sin(2*pi*10*t);
modulatedSig=carrier.*messSign;
y=hilbert(modulatedSig);
envelop=sqrt((real(y).^2)+imag(y).^2);
Diff=(max(envelop)-min(envelop))/5;
[peks,locs]=findpeaks(envelop,'MINPEAKHEIGHT',Diff,'MINPEAKDISTANCE',10,'THRESHOLD',0.05);
%figure;plot(envelop)
toc
댓글 수: 1
dpb
2020년 5월 20일
Timing granularity is probably the biggest culprit plus there's no control of when/what the OS does on task scheduling w/o a realtime OS.
The sizes here simply aren't large enough that they're the limiting factor...try additional multiples of the length--when you get to the point of cache size you'll probably see quantum jump. Whether you can catch the gradual over the number of floating pt operations would take doing lots of averaging I'd guess.
Of what significance is it, anyway?
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Quantum Mechanics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!