How to write a for loop which will take in all .wav files in a directory, compute spectrogram and save as an image

4 次查看(过去 30 天)
I am new to Matlab from the Python domain, and am looking to write a short for loop which will take all .wav files ( I have many .wav files in a single folder for training data for a machine learning project). I want to iterate through each .wav file in the folder and produce a spectrogram and save each spectrogram to the folder with the same name as the original .wav file.
All files are the same length (3 seconds) and are all sampled at 500kHz.
This should be straight forward but I am struggling a bit as this is my first time on Matlab

回答(1 个)

Mathieu NOE
Mathieu NOE 2020-10-9
hello
no panic ! I have the solution for you
the main function is : auto_process_all2.m
it needs the subfunction : spectrog_peak.m
it should be easy to you to modify your code - but I can continue to help you if needed

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by