Operational amplifiers (opamps) are one of the most widely used circuits in electrical engineering. This lab will introduce several uses for opamps including amplifiers and filters.
It is possible to use standard wav files as input to LTspice simulations. This allows you to input voice, music or ECG signals into your simulated filters before you build the filters and play the wav files through the computer into your actual circuit. You can get some ECG files from
http://courses.engr.illinois.edu/bioe415/labs/ecgwav.html, but I have already downloaded them and added noise to them, which you will need to remove with a filter.
To add a WAV file input to a LTspice simulation, right click a voltage source, then in the DC value field enter:
wavefile="ecgwav_noise.wav"chan=1. Note that every time you open the voltage module, the string is erased and has to be re-entered, BUT if you right-click the text instead, you can edit it (see below). More information on using wav files:
To save a waveform from a simulation as a WAV file, add a spice directive to the simulation by menu
Edit>Spice directive..., then in the edit box enter
.wave "filename" nbits, sample_rate V(node_name). Where nibts is usually 16 bits and the sample rate is 8000, 16000, or 44100. An example might be
.wave "loon.wav" 16 16000 V(Vout).
The file VCVS_bandpass_filter.asc displays the frequency response of a bandpass filter with cutoff frequencies at about [16 1600] Hz, marked by the white arrows. The vertical scale (on the left) is a log scale where 20db represents a factor of 10. More precisely
displayed_db= 20*log10(amplitude_voltage_out/amplitude_voltage_in) at each different frequency. The dashed line is the phase shift of the sine wave as it passes through the two filters measured in degrees on the right-hand scale. Note for that correct operation R9=R8, C3=C4, C1=C2 and R3=R5.
Simulate>Edit Simulation Cmd...then in the dialog click the
transienttab and choose a
stop time.). Change the input voltage source to sine and set the frequency to 1600 Hz. According to the phase plot below, the pahse shift should be -90 degrees (the minus means lagging the input). Is it?
VCVS_bandpass_filter.ascwhich takes a wav file of the noisy loon call and filters it with a high pass filter at about 500 Hz and a low pass filter at about 2.5 KHz. Save the result of the simulated filter as a wav file and listen to it (and demo to the TA).