Finding frequency and duration of an audio signal

10 visualizaciones (últimos 30 días)
Ban Coder
Ban Coder el 12 de Oct. de 2019
Comentada: Star Strider el 15 de Oct. de 2019
What is the frequency (not the sampling rate) and duration of this audio?
>> fs=24000.0; % Sampling rate
>> t=0:1/fs:1; % One sample each Ts=1/fs
>> x=cos(2pi1000t);
>> sound(x,fs);
I'm trying to learn signal processing ... and I can't find the answer to this question anywhere.
Thanks in advance.

Respuesta aceptada

Star Strider
Star Strider el 12 de Oct. de 2019
Editada: Star Strider el 12 de Oct. de 2019
You specified it to be 1 kHz, and 1 second duration, so it is just that:
fs=24000.0; % Sampling rate
t=0:1/fs:1; % One sample each Ts=1/fs
x=cos(2*pi*1000*t);
sound(x,fs);
L = numel(t);
fn = fs/2;
FTx = fft(x)/L;
Fv = linspace(0, 1, fix(L/2)+1)*fn;
Iv = 1:numel(Fv);
figure
plot(Fv, abs(FTx(Iv))*2)
grid
xlim([0 2000])
The Fourier transform plot demonstrates it.
  2 comentarios
Ban Coder
Ban Coder el 15 de Oct. de 2019
Thank you so much!
Star Strider
Star Strider el 15 de Oct. de 2019
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Signal Processing Toolbox en Help Center y File Exchange.

Productos


Versión

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by