to get matlab code that reads a wav file recorded for 30 seconds and do time sequence for fs 44100
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I want a matlab code that reads wav file recorded for 30 seconds and generates time sequence for sampling freq (fs 44100)
( just want to generate time sequence,thus to export t values that corresponding to amplitude of the wav file)
thanks
0 Kommentare
Antworten (1)
Walter Roberson
am 9 Sep. 2021
filename = 'YourFile.wav';
[y, fs] = audioread(filename);
thirty_secs = fs * 30;
assert(size(y,1) >= thirty_secs);
y = y(1:thirty_secs,:);
if fs ~= 44100
y = resample(y, 44100, fs);
end
Now y is the amplitude information for the first 30 seconds at 44100, even if the original was recorded at a different sampling frequency.
Siehe auch
Kategorien
Mehr zu Digital Filtering finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!