Info

此问题已关闭。 请重新打开它进行编辑或回答。

How can I use LPT-USB to trigger the output?

2 次查看(过去 30 天)
Junghee
Junghee 2013-12-9
关闭: Walter Roberson 2013-12-10
I have worked on some codes to filter the sound.
I asked few days ago if anybody knows how to turn LED light on by using LPT-USB port and MATLAB.. but nobody answered.
I have filtered the sound and have a frequency spectrum.
According to that specified frequency, I need to trigger the output with LPT-USB port.
Following is what I did 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)
I need to take live input in and send live output out... and I will use a microphone for a input device and LPT to USB port...(I found some info online- people said I could use LPT port to get output signal but I don't know if LPT-USB port is the right one)
Anyway, triggering the output or code for LPT-USB port.. anything is fine.
Please I'll appreciate any help.
Thanks

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by