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

조회 수: 6 (최근 30일)
Junghee
Junghee 2013년 12월 3일
댓글: Junghee 2013년 12월 10일
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