I know there are dozens of questions about how to extract the correct frequency out of data, however I probably don't interpret my data correctly, or do not apply those answers correctly.
Problem
I recorded data with an oscilloscope of a free running laser. The laser output is not constant, instead it has a pulsed behaviour, and I want to extract the main frequency (if it exists)
pulse = Import["http://ge.tt/api/1/files/9xhaouB2/0/blob?download", "Table", "HeaderLines" -> 5];
I processed the data with periodogram, given the sample rate of the data:
Periodogram[pulse[[All, 2]], SampleRate -> 5*10^6, Frame -> True,
GridLines -> {{5500}, None},
FrameTicks -> {{All, All}, {All, All}},
GridLinesStyle -> Directive[Red, Dashed], AspectRatio -> 1/4,
ScalingFunctions -> "dB", PlotRange -> {{0, 100000}, {-30, -100}},
ClippingStyle -> None]
Questions
From a first view I would think that there should be a dominant frequency around 5500 Hz (if it's an artefact, or real is another question).
Periodogram: Why do I need the [All, 2]? I copied it from another question here, but I can not locate it anymore and can not find the reason. Did I use the periodogram correctly, or is it just fortune that I have a negative (why?) peak at 5500?
How do I get the same picture with the Fourier transform? I tried the solution from Fourier transform of sampled data:
samplerate = 5000000; time = Length[pulse]/samplerate; nyq = Floor[Length[pulse]/2]; ListPlot[Take[ 10*Log10[(Abs@Fourier[pulse, FourierParameters -> {1, -1}])^2], nyq], Joined -> True, PlotRange -> Full, DataRange -> {0, (nyq - 1)/time}]
which creates absolutle nonsense (or I did). In principle, all the questions/answers are about scaling correctly the x-axis, but at least I did not get what I would have to do for my data.
- Is there a smart way to work with such datasets when they are bigger in Mathematica? The data shown here is a subset of the data, as the original one with a size of 20 MB used up to 3 GB of RAM on my computer.
5500
Hz ? $\endgroup$