필터 지우기
필터 지우기

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 CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by