1
$\begingroup$

I'm quite new to signal processing and am trying to find the short time fourier transform of an audio sample and plot it (I believe the best way is as a spectogram?) using Octave (similar to this MATLAB example).

I haven't gotten very far, I've successfully plotted the fft to get more familiar with MATLAB but I'm now stuck.

pkg load signal [audio, Fs] = audioread("file.wav") [matrix, args] = stft(audio, 512, win_type=1) %win_type 1 means hanning % [y, c] = stft (x, …) returns the entire STFT-matrix y and a 3-element vector % c containing the window size, increment, and window type % from https://www.mathworks.com/matlabcentral/answers/1698080-what-is-the-default-normalization-in-plot-of-stft-function-in-short-time-fourier-transform) % plot(matrix???) 
$\endgroup$
4
  • $\begingroup$ octave.sourceforge.io/signal/function/specgram.html $\endgroup$ Commented Nov 25, 2022 at 1:08
  • $\begingroup$ @Jdip how does specgram differ from STFT? Do they ultimately accomplish the same goal? $\endgroup$ Commented Nov 25, 2022 at 1:14
  • 1
    $\begingroup$ Yep, they do. specgram does the plotting for you if you don't specify any return arguments. $\endgroup$ Commented Nov 25, 2022 at 8:20
  • $\begingroup$ This video covers exactly what you're looking to do. $\endgroup$ Commented Jan 29, 2024 at 8:07

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.