Frantz’s Status Report for April 26

This Week’s Accomplishments:

This week, I finished the delay and sequencer, and I have nearly finished the real-time pitch shifter, with the exception of some debugging and edge-case testing.

As it turns out, using statically allocated memory is a lot easier than dynamic memory. Using pre-allocated memory buffers for storing the data is easier to implement, and it doesn’t take as many resources to run. With latency being such a concern, trading off space in favor of time is an easy decision. With window length down to 512 (instead of 2048), that also cuts our memory usage for the pitch-shifter. Nevertheless, with so much extra memory, this is not an issue.

After some debugging, the pitch-shifter does not segmentation fault anymore. Still, the output doesn’t match what it should be – I will check for implementation mistakes, testing with simple signals and moving on to actual guitar audio is going to help.

We will be finishing tomorrow.  We are almost there!

Team Status Report 4/26

This week, we tested the PCB and found that it was having some issue, so we shifted to getting a functional implementation using perf boards to ensure that we have something to demo. If some members have spare time, they may try to find the PCB issue and fix it after the perf board implementation is tested, so we may return to a PCB implementation by the demo. We had planned for this situation, and used backup designs and backup parts ordered earlier to make the perf board version, but there will likely still be some effect on the noise within the signal due to this change. The main risks are that something with the perf board version does not work in testing, which is unlikely due to our previous prototyping but would be very bad for the project, and that something with the final audio processing code has an issue. As the perf board implementation was already the backup for the PCB, our options for backup plans are limited, but we do have some plans for how to manage certain issues if they come up.

Unit and System Tests:

Audio Processing Software Testing: Simulated the code in python with a premade audio signal, found that the delay was fully accurate and the pitch was shifted to the correct note.

Microcontroller Testing: Testing the Daisy Seed for latency and accuracy of delay effect, found minimal latency from the MC itself, and that the delay effect was providing the expected outcome.

I/O Testing: Testing the I/O code with a prototype circuit to make sure it functions correctly, had some issues with the library used for the microcontroller, but fixed them and got I/O fully functional.

Prototype Testing: Testing combine audio processing and I/O code with prototype version of the circuit, found that delay effect produces less than 0.5ms of latency, is accurate, and that the amplitude attenuation is accurate within 1 percent of the goal, all while the I/O code is fully functional.

Full System Testing: Testing final implementation for correctness and that all the metrics from previous tests are maintained, as well as testing for pitch shift accuracy on final implementation and for signal to noise ratio. Not finished yet due to delay from PCB issue, should be done Sunday or Monday.

Nick Status Report 4/26

This week, I had my presentation, so I prepared for that early in the week. Later, after Chaitanya tested the PCB and found that there was an issue, we decided to make a perf board implementation of the project for now to get something functional by Monday. We met a few times to solder the circuit and get a working implementation based on what we made for the breadboard prototype. I also fixed the last few issues the I/O code was having. We are almost done, just need to meet Sunday and early next week to finish putting the final version together and test everything, and then do the video, poster, and report. Next week, I have a final early in the week and at the end of the week, so I will have the least time to work, but will still meet with everyone to finish getting the perf board implementation completed and tested, and will do parts of the poster, video, and report.

Team Status Report for April 19

Our most significant risks are if the Daisy Seed microcontroller doesn’t work as planned. We have already had to modify multiple segments of code to sidestep issues that have popped up, including not being able to access most of our microcontroller’s memory without a specific keyword. The Daisy user forums have been helpful for solving a lot of issues like this one, thankfully. Nevertheless, we are planning to complete more intermediate tests to catch any more issues that arise. We are also awaiting the arrival of our PCB, but we have connected our components with a wired circuit prototype, which works in our tests. We will build a soldered devboard as backup.

The only major change in our implementation was inserting an RC low-pass filter both before and after the signal passes through the microcontroller to cut out high-frequency noise. Also, we have made a few implementation tweaks. We have modified some code to account for quirks in the microcontroller, and we have made backup circuits for connecting our components.

We are slightly behind schedule, due to the PCB arriving late. However, we have been making major progress in integrating our parts together. Our tests have been fruitful. We will be testing extensively this week as we bring our individual components together.

Frantz’s Status Report for April 19

This Week’s Accomplishments:

This week, I made some more progress on the real-time pitch shifter. In the meantime, I also wrote code implementing the “delay” and “sequencing” functions.

We spent plenty of time testing our microcontroller with input from a function generator and a guitar, sending the output to an oscilloscope. We got our microcontroller to succeed in a few tests: first, we had it send input to output unmodified; then, we had it repeat an input once; next, we had it operate with the delay and sequencer functions. For the second of these, we played the output on a small speaker and heard the repeated strum. For the third, we verified that the time delay and the amplitude scaling matched our hard-coded parameters.

Early in our testing, realized that most (64MB of 65MB) of our microcontroller’s memory was in SDRAM that wasn’t able to be allocated normally. After a while, we discovered a way to statically allocate memory into SDRAM on the Daisy Seed microcontroller: using the keyword “DSY_SDRAM_BSS” when initializing an array. This allowed our microcontroller to fit our delay and sequence buffers, each containing 2 s worth of samples, into memory.

We also have worked on our presentation slides for next week. We took images and video of some of our results as documentation of our progress and testing.

Schedule-wise, we are catching up and nearly finished. We are integrating a lot of our independently-creating components, and the resulting progress has been quite a relief. We will continue integrating this week, and I will finish the delay and sequencer code, accounting for some edge cases and more user input. I will also finish the pitch-shifting as soon as I can.

During capstone, I have honed skills such as task delegation, communication, considering end users, and prototyping code. However, I have also learned a very concrete skill: coding in C++. I started learning the basics using a couple short online video tutorials. I started by building a function that I could use to test the pitch-shifter. This allowed me to make progress while making a program that would be easy enough for me to get the hang of the language. I also have used a lot of online resources, such as the C++ documentation site and Stack Overflow, to answer questions in regards to implementation.

Nick Status Report 4/19

At the start of the week, I worked on fixing the last major issue the interface code was having, and tested it with Chaitanya. Then, I tested inputs to the microcontroller from a function generator with Josie. Later in the week, I made an updated version of the interface code with all the implemented fixes for the major issues we were having, worked on the slides for the final report, and met with my group to test the combined interface and audio processing code on a breadboard prototype of the full circuit to check is functionality and test the output of the code for latency and that the audio processing code was accurately applied. After testing, we found a few small issues in the code, but nothing that prevented it from being mostly functional and providing the expected output. We seem to be slightly behind because of the PCB delay, but we will have time to implement that, fix the last few issues and have the full system completed and ready to test very soon. Next week, I will prepare for my presentation, fix the last few issues with the interface code, and meet with my group to implement the finished version of the pedal and test it.

As for what I individually learned, I first learned that hardware implementations run into many more issues than I expected. I learned how to design a schematic for hardware without any premade sections or guidance, as all of my previous classes related to this had either premade schematics or guidance with preselected components. I also learned how to find good hardware components and understand datasheets from spending so long looking through DigiKey for components that fit our design. Finally, I learned how to better understand and find issues with a software library, as the Daisy library is not fully functional and I spend a while looking through online references and forums to get the interface code working.

Team Status Report for April 12

The most significant risks we face are the PCB not working, the microcontroller taking too much time to complete the operations, and the output being too noisy. We have contingencies for all of these possibilities: we are making a backup devboard for connecting our components if our PCB is faulty, we are using a low-pass RC filter to remove high frequency noise from our output signal that could cause aliasing before our microcontroller’s ADC, and we are prepared to change macros in the code that will change the window size in case 2048 samples is too many for low-latency pitch shifting.

We slightly changed our implementation, primarily in the physical structure of our pedal. We are accommodating a PCB with a larger size than originally anticipated. Overall, this shouldn’t change costs too much; it may require slightly more 3-D printing material.

We are slightly behind schedule, so all of our remaining work will be compressed into the remainder of our time. We will each be devoting a lot of time to covering the last touches of our implementation, testing, and our final deliverables.

We are planning to test our pedal by measuring its output by ear and using an oscilloscope. This should allow us to measure our latency (by calculating the difference between the peaks and troughs in our input and output signals) and signal-to-noise ratio with precision, and we can ensure our pedal works within our use-case requirements. We will be sending musical signals into our pedal via a function generator and a guitar (including multiple styles of playing) as well as chaining our pedal in series with other pedals, to ascertain that our pedal works in a real-life setting. Naturally, we will be running tests with all of our pedal’s parameters and ensuring that changing the parameters during use poses no issues.

Nick Status Report 4/12

The past two weeks, I have assisted with verifying the circuit for the PCB, made the interface code for the pedal, created test codes for debugging the pedal, met with Chaitanya to debug the interface code, modified the plans for the 3d model due to changes with the PCB, and made designs for the input circuit. The interface code is mostly working, with only the buttons and the rotary encoder still having issues, but this is likely due to some confusion with the Daisy library, as the classes for switches and encoders seemingly are in progress. I have already made some alternate files to test possible solutions and am working on making versions of the code that use the standard GPIO class, which we know works as I used it for the other components, but I am hoping that we can get the Daisy classes working as their debounce function would likely work better for our pedal. For the 3D model, after learning that the PCB size would be much larger than initially planned, I remade the models to fit the new PCB and sliced them, and it seems that the base at this new size would be too expensive to print, so I moved the holes for connections in the base to the faceplate, and will find a premade plastic box that we can use as the base. Overall, this shouldn’t affect the functionality. Our progress seems to be slightly behind, although not by much, as we should be able to catch up early in the week and hopefully start testing. Next week, I will fix the last few things with the interface code, add the holes to the faceplate model and send it for printing, finalize the breadboard version of the circuit for testing, start testing once the audio processing code is fully converted to C++, do my part of the presentation slides, and prepare for the presentation.

As for testing of my own subsystems, as of now, I made most of the circuit in tinkercad while we were designing to test functionality and have made and modified multiple test files for the interface code to debug the individual subsystems of the interface. For the tests I plan to do in addition to the tests we are doing on the whole system as discussed in the team report, I plan to test the system with the full code and compare it to a preset input with just the audio code to determine if there is any significant impact from the interface code on latency, and plan to test the overall noise impact of some of the changes in our design.

Frantz’s Status Report for April 12

This Week’s Accomplishments:

This week, I spent a lot of time working on my C++ code, to be loaded onto our microcontroller. I have completed most, but not all of the real-time pitch-shifting algorithm, with quite a few roadblocks. The first was that I found great difficulty in importing a library for computing the Direct Fourier Transform. In order to minimize the difficulty of interacting with a new interface, I wrote my own DFT code myself, following the Cooley-Tukey radix-2 algorithm. I also wrote code for the Inverse Direct Fourier Transform, which was a simple edit of the DFT code.

Here is my current DFT code, with some print debugging commented out:

I have not yet optimized my code for quickness or implemented garbage collection, which will be necessary for programming in C++. However, I have tested my code and found that for a few test inputs, my output matches that of the Python function “numpy.fft.fft”.

I have found some difficulty in converting my previous Python algorithm not just into C++ but into a real-time operation. This is still in-progress. I will need to test my code’s performance to ascertain what amount of latency is safe.

I have used the micro-USB cable I ordered to connect our microcontroller to my laptop. Next week, I aim to start by learning how to use the Daisy Library to receive input samples and send output samples. I will then implement the “delay” functionality, which is comparatively simple.

We are somewhat behind our original schedule and a little pressed for time. Nevertheless, we are confident in our ability to complete our project in the next week. I will spend a lot of time completing and testing my code within the next few days.

Frantz’s Status Report for March 29

This Week’s Accomplishments:

This week, I began programming in C++. I first created functions to extract samples from a .wav file and create a new .wav file using a list of samples. This allows us to easily test our algorithms using imported sound files. Then, I began reworking the pitch-shifting algorithm in C++. I am modifying it so it completes the task in chunks, which is vital for outputting data in real time with minimal latency. I tried importing the FFT library “shy_fft,” but it doesn’t seem to work properly. After a lot of troubleshooting, I switched to “FFTW.”

Additionally, I ordered a micro-USB cable with data transmission for connecting our microcontroller to a computer.

Status:

Our schedule is on track, but time is getting tight. We will stay diligent to complete our project satisfactorily.

Next Week:

Next week, I will continue rewriting the phase vocoder algorithm for real-time use in C++. I will test the FFTW import to ensure that it works properly. When I am done, I will start writing the delay algorithm.