SignalAnalysis.jl icon indicating copy to clipboard operation
SignalAnalysis.jl copied to clipboard

add support for psd function to return the output result as variables or expose base function

Open AbelHo opened this issue 5 years ago • 2 comments

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.

AbelHo avatar Dec 23 '20 04:12 AbelHo

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.

mchitre avatar Dec 23 '20 04:12 mchitre

As discussed with @AbelHo, there may be value in having this available for multichannel signals.

mchitre avatar Dec 25 '20 15:12 mchitre