Spectrogram time axis samples to actual time
2 Comments
Accepted Answer
Include the sampling frequency, and the result is a time-frequency plot (rather than an index-frequency plot). See for example: Spectrogram and Instantaneous Frequency (link). Note that fs must be the fifth input to spectrogram. To input a sample rate and still use the default values of the preceding optional arguments, specify these arguments as empty, [].
3 Comments
I would simply change the filenames for each spectrogram your function creates by adding a number to the end, for example ‘spectrogram_001.ext’ etc., where ‘.ext’ determines how you want to save it (as .fig, .png, etc.). You can do that with sprintf, possibly saving the number as a persistent (link) variable inside the function, then updating it in each iteration if necessary.
I’m guessing what you’re doing, and my ‘solution’, such as it is, reflects that.
More Answers (0)
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!