フィルターのクリア

How to make real-time frequency detector

8 ビュー (過去 30 日間)
Jaehyun Kim
Jaehyun Kim 2018 年 10 月 14 日
Hi, I could make frequency detector(actually frequency analyzer) when I input several second with laptop microphone.
And, what i wanna make is real-time frequency detector. I made it with Processing (check out processing.org) with simple code.
The code i made is like below.
time_rec = 15;
fs = 8000;
recObj = audiorecorder(fs,16,1);
set(recObj,'TimerPeriod',0.1,'TimerFcn',@call);
record(recObj,time_rec);
sound(x);
function [x] = call(h,~)
x = getaudiodata(h);
X = fft(x);
N = length(X);
P = abs(X/N);
Amp = P(1:N/2+1);
Amp(2:end-1) = 2*Amp(2:end-1);
fs = 8000;
f = fs*(0:(N/2))/N;
hold off;
plot(f, Amp);
end
And it acts like cumulative analyzer, which have memory. What should i fix to make it real-time?

回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by