Displaying plotted real time data

1 view (last 30 days)
Maamoun Ahmed
Maamoun Ahmed on 27 Sep 2016
I am trying to display the data that is being acquired and plotted from the microphone on real-time. It is one of the Matlab examples. How to display / save / process the data.
d = daq.getDevices;
dev = d(2);
s = daq.createSession('directsound');
addAudioInputChannel(s, dev.ID, 1:2);
%fid1 = fopen('log.bin','w');
s.IsContinuous = true;
hf = figure;
hp = plot(zeros(1000,1));
T = title('Discrete FFT Plot');
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')
grid on;
plotFFT = @(src, event) helper_continuous_fft(event.Data, src.Rate, hp);
hl = addlistener(s, 'DataAvailable', plotFFT);
s.startBackground;
figure(hf);
pause(inf);

Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!