Need to turn LED lights on by using LPT port - So far, used FFT and Bandpass filter

6 次查看(过去 30 天)
Hello
Following is what I have so far:
% Reading wav file
b=wavread('/Users/*******/Desktop/traffichonk.wav');
% Selecting a portion (37s to 41s)
b1=b(44100*37:44100*41);
size(b1)
% FFT algorithm
n=176401;
fs=44100;
ts2=1/fs;
tmax2=(n-1)*ts2;
t2=0:ts2:tmax2;
f2=-fs/2:fs/(n-1):fs/2;
z2=fftshift(fft(b1));
% Plotting the sample b1
figure(1)
plot(t2,b1)
title('Plot of a Sound Sample');
xlabel('time(s)');
ylabel('Sound data');
% Plotting the Frequency Spectrum
figure(2)
plot(f2,abs(z2))
title('Frequency Spectrum');
xlabel('Frequency Hz');
ylabel('Amplitude');
% After bandpass toolbox is used, alert saying "The variable 'Hbp' has been
% exported to the command window.' will show up.
b2=filter(Hbp,b1);
z3=fftshift(fft(b2));
% Plotting the frequency spectrum after filtering
figure(3)
plot(f2,abs(z3))
title('Frequency Spectrum after Filtering');
xlabel('Frequency(Hz)');
ylabel('Amplitude');
% Checking the sound
soundsc(b2,44100)
-> NOW
According to my research, I figured I can use LPT port to connect LED lights to the computer as an output source.
I need a code that can trigger the output based on what I have..
Right now, I'm trying to use 1 LED light to just make it work, but my actual goal is to use 6 LED lights and 6 microphone sensors.
When individual microphone sensor senses the sound, relevant individual LED light is suppose to light up.
If anybody knows how to program either one, please help me out.
Thank you A LOT in advance!!
- Bri

回答(1 个)

Walter Roberson
Walter Roberson 2013-12-9
编辑:Walter Roberson 2013-12-10
  3 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Filter Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by