Recently I'm spending my time implementing some patients' analysis using Mathematica Classify function. But I need to rewrite some MATLAB functions for computing input parameters.
There is a problem, that I haven't found an alternative for pmtm function.
In short:
Is there any way how to rewrite this code in Mathematica?
[p,f] = pmtm(data,tapers,n,fs);
Where data is a column vector with 2048 elements, fs = 40, tapers = 8 and n = 2^nextpow2(size(data,1)) = 2048;
Edit:
1. Link to pmtm function is http://www.mathworks.com/help/signal/ref/pmtm.html
2. [pxx,f] = pmtm(x,nw,f,fs) returns the two-sided multitaper PSD estimates at the frequencies specified in the vector, f. The vector, f, must contain at least 2 elements. The frequencies in f are in cycles per unit time. The sampling frequency, fs, is the number of samples per unit time. If the unit of time is seconds, then f is in cycles/sec (Hz).
pmtm = MFunction["pmtm", "OutputArguments" -> 2]after you initialize the package. You'd call it as{p, f} = pmtm[data, tapers, n, fs]. – rm -rf Jan 07 '15 at 15:47pmtmfunction, but inMathematica I can useCCodeGeneration. – Zdeněk Tesař Jan 07 '15 at 16:08edit pmtm. That should give you hints to proceed with your translation attempts. – rm -rf Jan 07 '15 at 16:10