I have imported a sound file into Matlab using [sound,fs]=audioread('....')
I need to find the sampling frequency. I think that is fs, however when I import a different sound, my fs value does not change? Is there a difference between sampling rate and sampling frequency, and if there is how do I find the sampling frequency from the audiofile imported?

1 commentaire

Aliu Moshood
Aliu Moshood le 6 Avr 2022
Sampling frequency is the inverse of sampling rate. You can also relate this to the physics relation between period and frequency of a wave. According to physics, the relation between period (the time taking for a wave to complete a cycle) and frequency is {frequency = 1/period}.

Connectez-vous pour commenter.

 Réponse acceptée

Ameer Hamza
Ameer Hamza le 9 Oct 2020

1 vote

Yes, fs is the sampling frequency. Sampling frequency and rate are related to each other: frequency = 1/rate. And it is not strange that two files have the same sampling frequency. Most of the audio signals are recorded at a similar sampling frequency, e.g., 44.1 kHz.

3 commentaires

Rhyston Da Silva
Rhyston Da Silva le 9 Oct 2020
Thank you very much for your answer, that makes sense.
It is just a bit strange as to the fact that they want me to compare the sampling frequencies of the two audio signals, so I did not expect them to be the same. Both files are recorded at 16 kHz, at least that is my fs output.
Ameer Hamza
Ameer Hamza le 9 Oct 2020
They may want you to compare the frequency content (discrete Fourier transform) of the signal, which can be calculated using fft() of the signal.
Rhyston Da Silva
Rhyston Da Silva le 11 Oct 2020
Yes, after some investiagtion I also think so. That is what I will do. Thank you again for your assistance.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Audio I/O and Waveform Generation dans Centre d'aide et File Exchange

Produits

Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by