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

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

Answers (1)

3 Comments

Hi thanks for your answer.
I was actually looking for somewhat exact way or code that can help me.
I'm not a professional who knows how to implement a code into my own..
I kind of researched on these already on my own so yes I did saw most of your recommendations.
But I still don't know what to do with these and that's why I asked here.
Reading them didn't make me understand what those codes actually do..... :(
My LED light doesn't have to turn on for millisecond.
It actually has to last as long as the sound is on.
Live input to live output.
So far, I watched youtube tutorials and taught myself how to do FFT and filter stuff but I couldn't find related video for triggering the output with live sound input..

Sign in to comment.

Asked:

on 3 Dec 2013

Commented:

on 10 Dec 2013

Community Treasure Hunt

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

Start Hunting!