Generating a time vector

2 views (last 30 days)
Xhi Pika
Xhi Pika on 30 May 2022
Commented: Star Strider on 4 Jun 2022
How do i generate a time vector p2 that contains 𝑛 number of samples in the range from 0 to the time duration of the sound signal in sa2.wav. Here, 𝑛 is a fixed number dependent on the length (number of samples) of the auditory spectrogram.

Accepted Answer

Star Strider
Star Strider on 30 May 2022
Try this —
[y,Fs] = audioread('sa2.wav');
L = size(y,1);
p2 = linspace(0, L-1, L)/Fs;
Star Strider
Star Strider on 4 Jun 2022
Ask your professor or teaching assistnat to clarify the assignment for you.
The stft function (introduced in R2019a) will likely be helpful as will the bandpower funciton.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!