Generating a time vector

18 visualizaciones (últimos 30 días)
Xhi Pika
Xhi Pika el 30 de Mayo de 2022
Comentada: Star Strider el 4 de Jun. de 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.

Respuesta aceptada

Star Strider
Star Strider el 30 de Mayo de 2022
Try this —
[y,Fs] = audioread('sa2.wav');
L = size(y,1);
p2 = linspace(0, L-1, L)/Fs;
.
  4 comentarios
Star Strider
Star Strider el 31 de Mayo de 2022
This seems to be a homework assignment (and I have no idea with ‘fig.3’ shows), and all that should have already been covered either in class or discussed in your textbook. The relevant MATLAB functions are probably fft, stft, pwelch, pspectrum, and spectrogram. (The units of the pspectrum function plot with the 'spectrogram' option are different from the units of the spectrogram plot.) Others may also be appropriate.
Star Strider
Star Strider el 4 de Jun. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by