Number of samples - how to calculate it?

4 ビュー (過去 30 日間)
claudio
claudio 2016 年 5 月 12 日
回答済み: dpb 2016 年 5 月 13 日
Hello everybody! I am writing a code to play DTMF tones, and need to play them for 0.5 seconds. My question is: how to calculate the number of samples [n]? I tried to apply fs/f0 but the result was a small range. I am using FS = 8000 Hz. Thank you!!!
fs = 8000;
% Below I tried to use 5000 just for testing my code, and worked well:
n = [0:5000];
tone0 = (1.5)*cos(0.73906*n)+(1.5)*cos(1.04929*n);

採用された回答

dpb
dpb 2016 年 5 月 13 日
8000 Hz --> 8000 samples/sec * 0.5 sec --> 4000 samples

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Mobile についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by