Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
Junghee
Junghee le 3 Déc 2013
Commenté : Junghee le 10 Déc 2013
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

Réponses (1)

Walter Roberson
Walter Roberson le 9 Déc 2013
Modifié(e) : Walter Roberson le 10 Déc 2013
  3 commentaires
Walter Roberson
Walter Roberson le 10 Déc 2013
Do you have the Data Acquisition Toolbox ?
Junghee
Junghee le 10 Déc 2013
nope.. I don't see it

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by