This week I spent a lot of time refining the circuit simulator. I also worked on developing some tools by which the simulator can be easily tested against a variety of input waveforms. At this point, I am very confident that components such as resistors, capacitors, and inductors work correctly. This is more than enough to build basic filters. In order to implement some of the guitar pedal effects we want, we’ll also need to test diodes and transistors. This could prove to be a bit more challenging, as the IV curve for a transistor is not really the same from device to device like it is with capacitors, inductors, and resistors. Ultimately, implementing these components will probably require us to read some datasheets for the exact transistors/diodes that make up the pedal we are trying to simulate.
I also worked on a test suite of small circuits and waveforms that can be used for testing. I wrote a small script that generate waveforms (either sinusoids, square waves, or high frequency noise) and export them in the format that the simulator expects as input. I also manually created a few new circuit netlists for testing. Now that we have our test suite set up, we are able to look at some more complicated waveforms. For example, here is high frequency noise being passed through an RLC low pass filter. It is clear that the filter smoothes out some of the high frequency components of the original signal.
This also allows us to test the models for individual components using extremely simple circuits. For example, we can verify that our capacitor model behaves in a reasonable manner by looking at the following waveform, showing the response of an RC filter to a square wave:
This allows us to do a basic sanity check of our component models–it is clear from this waveform that the capacitor charges and discharges as expected.
This allows us to have higher confidence in the accuracy of our simulations, but ultimately it is still a qualitative approach to testing. Much of our efforts over the next week will be spent on implementing our full test bench to enable us to really quantify our error/accuracy. We also plan to meet on Sunday (3/24) to integrate all three of our components ahead of the in-lab demo which is right around the corner. This will probably take a fair amount of my available time next week, and we also lose one working day in lab for the ethics discussion, but I hope to also have some time to test the diode model in the coming week. I ultimately think that I am fairly on-track, though I do think I should speed up my development pace a bit in order to account for the fact that bugs are likely to arise as we progress, and I want to have time to deal with them without killing our schedule.