We can get the spectrograms of a signal which is a 2D matrix. How do I get back from the columns of the spectrogram to the time stamps in original signal? For example, what time stamp does the columns index ‘x’ belongs to (i.e. 1.3 sec in the file)?
I do not want the re-construction of the original signal, only relation between column number in spectrogram to a timestamp in the original signal.
So in MATLAB:
- read audio file:
[X, fs] = audioread('file.wav');
- Create spectrogram:
[S, F, T, spec] = spectrogram(X, 128, 64, 256, fs); where 128 window length, 64 is overlap, 256 is number of fft bins and
fs is sampling frequency 16KHz.
spec is a 2D matrix, in which the rows represents the frequency and columns represents the time.
X is a one dimensional array which represents the samples of the
file.wav is say
3.5 seconds duration and
spec will be of
129 x 700 dimension matrix.
Question: I want to know the correspondence of the columns number of the
spec with the timestamp of the
file.wav. E.g columns number 100 corresponds to 0.75 seconds in the original file