Open AbelHo opened 3 years ago
Just had a look at the psd()
and specgram()
code:
psd()
is computed with essentially a single statement:
p = welch_pgram(x, nfft, noverlap; fs=framerate(x))
and freq(p)
gives you the frequency bins and power(p)
gives you the PSD value.
specgram()
is computed with also essentially a single statement:
p = spectrogram(x, nfft, noverlap; fs=framerate(x))
and time(p)
, freq(p)
and power(p)
give you the time values, frequency bins and the spectrogram value respectively.
Both welch_pgram()
and spectrogram()
come from the DSP package, so you'll need using DSP
.
Since these are single liner calls, we don't gain much by wrapping them further. Suggest using these directly instead.
As discussed with @AbelHo, there may be value in having this available for multichannel signals.
psd function is useful for automated data analysis process the output as well, would be nice to have it as a function call instead of just a plot.