Skip to content

Instantly share code, notes, and snippets.

@simonster
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonster/d4fd22e10364465f9718 to your computer and use it in GitHub Desktop.
Save simonster/d4fd22e10364465f9718 to your computer and use it in GitHub Desktop.
using DSP
N=1024*32;
x0=rand(N);
nn=div(N,8);
mm=div(N,16);
println("welch_pgram")
f(x0, nn, mm) = for i = 1:1000; power(Periodogramt(x0,n=nn,noverlap=mm,twosided=true,window=false)); end
f(x0, nn, mm);
@time f(x0, nn, mm);
println("periodogram")
f(x0, nn, mm) = for i = 1:1000; power(Periodogramt(x0,n=N,noverlap=0,twosided=true,window=false)); end
f(x0, nn, mm);
@time f(x0, nn, mm);
println("spectrogram")
f(x0, nn, mm) = for i = 1:1000; spectrogram(Periodogramt(x0,n=nn,noverlap=mm,twosided=true,window=false)); end
f(x0, nn, mm);
@time f(x0, nn, mm);
using DSP
N=1024*32;
x0=rand(N);
nn=div(N,8);
mm=div(N,16);
println("welch_pgram")
f(x0, nn, mm) = for i = 1:1000; welch_pgram(x0, nn, mm; onesided=false); end
f(x0, nn, mm);
@time f(x0, nn, mm);
println("periodogram")
f(x0) = for i = 1:1000; periodogram(x0; onesided=false); end
f(x0);
@time f(x0);
println("spectrogram")
f(x0, nn, mm) = for i = 1:1000; spectrogram(x0, nn, mm; onesided=false); end
f(x0, nn, mm);
@time f(x0, nn, mm);
using DSP
N=1024*32;
x0=rand(N);
nn=div(N,8);
mm=div(N,16);
println("welch_pgram")
f(x0, nn, mm) = for i = 1:1000; welch_pgram(x0, nn, mm); end
f(x0, nn, mm);
@time f(x0, nn, mm);
println("periodogram")
f(x0) = for i = 1:1000; periodogram(x0); end
f(x0);
@time f(x0);
println("spectrogram")
f(x0, nn, mm) = for i = 1:1000; spectrogram(x0; n=nn, m=mm); end
f(x0, nn, mm);
@time f(x0, nn, mm);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment