Download Optical Theremin Design Review - Sites@PSU

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Bode plot wikipedia , lookup

Spectrum analyzer wikipedia , lookup

Electronic musical instrument wikipedia , lookup

Spectral density wikipedia , lookup

Loudspeaker wikipedia , lookup

Pulse-width modulation wikipedia , lookup

Sound reinforcement system wikipedia , lookup

Dynamic range compression wikipedia , lookup

Utility frequency wikipedia , lookup

Audio crossover wikipedia , lookup

Chirp spectrum wikipedia , lookup

Public address system wikipedia , lookup

Electrostatic loudspeaker wikipedia , lookup

Wien bridge oscillator wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Transmission line loudspeaker wikipedia , lookup

Regenerative circuit wikipedia , lookup

Opto-isolator wikipedia , lookup

Heterodyne wikipedia , lookup

Transcript
Optical Theremin Design Review
Optical Theremin
Ethan N Rozak, Dave Mewkalo, Ken Rink
Penn State University
March 2016
1
Optical Theremin Design Review
2
Abstract
The Optical Theremin design consists of two photodiodes, an operational amplifier, five
resistors, three LEDs, and a speaker. A MyDAQ is used to provide power and run the LabVIEW program.
The photodiodes detect light and generate leakage currents as the levels change. A trans impedance
amplifier produces voltages from these currents. The MyDAQ samples the currents and feeds them into
a program that generates an audio signal. This program gives the user control over the frequency range,
volume level, light sensitivity, and frequency band. An auto tune feature can be toggled on and off from
the control panel. The LEDs are used to determine if the audio signal is in the bass, midtone, or treble
frequency band.
Introduction
Theremins are typically constructed using antennae to sense the motion of a person’s hands and
generate an audio tone. This Optical Theremin uses photodiodes in place of the antennae. By replacing
the antennae we’ve created a smaller design that produces the audio signal using a LabVIEW program.
This program reduces the number of physical components needed to construct the Theremin and allows
the user to control the system settings.
The program provides the user with the simple graphical interface in figure 7. Knobs and sliders
are used to control the Theremin’s ambient light sensitivity, frequency range, and max volume. A switch
on the control panel turns on an auto tune function to adjust the output frequency. Three other sliders
give the user control over the band range for bass, treble, and midtone range. The LabVIEW program
shows a plot of the simulated audio signal so the user can observe the effect various motions have on
the music being played by the system.
Rationale
Our solution follows the guidelines laid out within the Lab handouts. Each new lab during the
first three weeks provided a new challenge to the project and forced us to adapt our solution as we
progressed to meet these new and changing needs.
We began by designing a simple optical Theremin. The first component to the project was the
development of the optical circuit. Provided with two photodiodes and an op amp chip we designed a
simple circuit to amplify the signals. The op amps were used in conjunction with resistors to create a
trans impedance amplifier to convert current signals into voltages. The amplified signals were then sent
into the MyDAQ to be read by our LabVIEW code in figure 8.
Within the LabVIEW VI we decomposed our project into further subVI’s for simplicity. As the two
signals entered the LabVIEW code; they were sampled and fed into two seperate subVI’s, the amplitude
subVI in figure 9 and the frequency subVI in figure 10, that manipulated them into more usable forms.
These were sent to a signal generator to create a sine wave based on the amplitude and frequency
values from our signals. This process kept the design simple and easier to understand and modify. The
output sine wave was read by the audio out port on the MyDAQ and converted to music.
The next phase of the project was to add an autotune feature. The autotuner would coerce the
input frequency to the closest frequency on the traditional musical scale (ie. D, D#, E, etc.). This was
done by feeding the frequency signal into the autotune subVI in figure 12. The subVI in figure 11
compared the signal to an array of “scale frequencies” and output the closest frequency to the sine
wave generator. The array and its corresponding methods provided an easy way to compare values and
choose the appropriate one.
Optical Theremin Design Review
3
The final portion of the project was to design an equalizer that could filter the signal and light up
a set of LED’s to indicate what range the frequency was in (treble, midtone, or bass). Before the sine
wave was sent to the audio output, it first went through the equalizer subVI in figure 13. Using three
bandpass filter VI’s, we filtered the signal and had a comparator generate outputs to the LED.s,
indicating the appropriate range. The filtered signal was sent to the audio output of the MyDAQ. The
filter VI’s were express VI’s that allowed us to choose different frequency ranges.
Implementation
Shown below in figure 1, is the first block diagram created for part one of this project. Figure 1
illustrates the basic flow of information through the optical Theremin, along with the outputs and inputs
required based on our design. A more detailed diagram can be found in appendix A.
Figure 1: Level 0 design block diagram for an optical Theremin
As shown the optical Theremin begins by exposing two photodiodes to a light source. The two
photodiodes then act as a current source producing the inputs for the physical circuit seen in the
diagram. The physical circuit uses op-amps to convert and amplify the current signal into a voltage signal
where it is then feed into the MyDAQ. For further detail about the physical circuit refer to appendix B.
The analog voltage signals are then read continuously by the MyDAQ. During this point the analog
signals are averaged to a scalar values and sent to two LabVIEW VI's. The two VI's, Frequency VI and
Amplitude VI; are both responsible for normalizing the analog input signals and controlling the intensity
levels for each photodiode using the intensity control shown in the diagram. Using the frequency control
slider, the user will set a range for frequencies that the optical Theremin will operate in. This range of
frequencies is then input into the frequency VI to be used to scale the normalized data. The scaled data
set is then offset for the lower limit of the slider value and coerced to stay within the frequency range
set by the user. The amplitude VI in a similar fashion will scale the normalized amplitude signal based
on a master volume control set by the user and is coerced to remain within the range set. Once the two
VI's have altered the input signals, they send the adjusted output to waveform charts on the LabVIEW to
display the normalized signals. The scaled data is sent to another DAQ assistant similar to the one used
Optical Theremin Design Review
4
to acquire the raw analog values. The second DAQ assistant then produces a simulated sine wave based
on the input frequency and amplitude signals. Finally, the simulated sine wave is sent to a third DAQ
assistant which controls sends the sine wave to the 3.5mm TRS connector on the MyDAQ in the form of
a soundwave.
Using the bill of materials included in appendix C, along with the circuit diagram and the initial
block diagram previously reviewed; Notorious ENG built the physical circuit and the LabVIEW code to
output sound based on the photodiodes. After testing the circuit, it was found that the range of voltage
values being produced by the amplifiers were too high for the MyDAQ input ports shown in appendix D.
As a result, the values for the resistors used in the circuit shown in appendix B had to be changed to
supply a smaller gain. This was an easy task since the gain was based on a ten point scale so the 10MΩ
resistor was replaced with a 1MΩ resistor.
Once the issue with the MyDAQ input errors were resolved the addition of parts two and three
of the optical Theremin project began. Part three of this project was the addition of an audio equalizer
that would be able to trigger LED's to light based on various frequency ranges while supplying the user
controls for the intensity of the three frequency ranges on a 20-20kHz scale. Part two was the addition
of an auto-tune VI which the user could choose whether to operate or not from the front panel.
Given the requirements briefly covered above, a finalized block diagram was constructed as
shown in appendix E (legend included) and below in figure 2. As a group, we placed the auto-tune and
audio equalizer between the second DAQ assist and the amplitude and frequency VIs. Additionally, as
shown in appendix E the LED functionality of the equalizer was not included in the Equalizer VI but
rather made a separate module of Boolean checks connected to the output of the frequency VI which
would turn a set of virtual LEDs and real LEDs on depending on what range contains that frequency.
Along with the additional blocks in the second block diagram, there were many user inputs which we
also added. In the Sound File input block, the user can choose whether the audio equalizer will output a
pre-downloaded sound file. Additionally, the Master volume control will provide the user with an
additional means to control the amplitude or volume of the final sound wave. The audio equalizer
controls allow the user to set the volume of trebble, bass and midtone frequencies. Lastly the Boolean
Auto-Tune control will determine whether the frequencies output by the frequency VI will conform or
tune to specific notes based on a twelve note scale.
Optical Theremin Design Review
5
Figure 2: Second 0 level design block diagram including Audio Equalizer and Auto-Tune
The project took three weeks to complete and was able to perform all design requirements
discussed in this document except for the equalizer's ability to play sound files. In the Sound file block
shown above the conditional statement used to send either optical Theremin data or a .wav file to the
third DAQ assist failed with an error of "Input sample speed maxed". The screenshots of the final
product can be found in the appendix of this document.
Conclusion
Overall, our design produced a higher quality and dynamic system that could effectively
convert different light intensities into an output sound wave. The main difficulty that we ran
into when implementing our system was the failure to read a sound file (.wav file). While this
was a missing requirement, we were still able to build a working and functional optical
Theremin. Through our design and eventual implementation, we were able to follow step by
step the requirements necessary to complete the project and overcome many operational
difficulties. By simplifying different aspects of the project into their own subVI’s, we were able
to keep to separate components to work on and keep the solution simplistic.
Optical Theremin Design Review
Appendices
Appendix A: Initial Block Diagram
Figure 3: Inital Block Diagram with levels N0 and N1 design depth
6
Optical Theremin Design Review
Appendix B: Physical Circuit
Figure 4: Physical Circuit design overview
Appendix C : Bill of Materials
Bill of Materials
Texas Instrument’s TL074 Op-Amp
LED (3x)
National Instruments MyDAQ
Medium Prototyping Board
Photodiodes (2x)
Headphones or speakers
Spool of Wire
Agilent power +15V power supply
Appendix D : MyDAQ Ports
Figure 5: MyDAQ input channels used for this project
$ .57 each
$ .21 each
$200 each
N/A
N/A
N/A
N/A
N/A
7
Optical Theremin Design Review
Appendix E: Final Block Diagram
Figure 6: Finalized Block diagram design
8
Optical Theremin Design Review
Appendix F: LabVIEW Screen Captures
Figure 7: Main Program Front Panel
Figure 8: Main VI Block Diagram
9
Optical Theremin Design Review
Figure 9: Amplitude sub VI
Figure 10: Frequency sub VI
10
Optical Theremin Design Review
Figure 11: Frequency Scale sub VI
Figure 12: Auto Tune sub VI
11
Optical Theremin Design Review
Figure 13: Equalizer sub VI
12