Tyson Wiseman – Project Update, Setbacks, and New Findings

This week, I looked into figuring out the frequency reading for my sound sensor, as this is a key portion of my project. While I could properly track the amplitude sensed by the sound sensor, I did not get any closer to finding frequency until this week. I looked at various ideas, and returned to the video I originally found the code that I used. Reviewing the daadidas yeezy 700 v3 nike air max 1 ultra moire black white ราคา shampoo isdin lambdapil Mexico ciorapi compresivi pana la coapsa scarpe eleganti senza lacci nike air max 1 ultra moire black white ราคา дамски памучен чорапогащник plavky chlapec 128nove játék hajszárító árukeresö vans chima ferguson pro 2 port royale black forty two skateboard shop jayden daniels jersey játék hajszárító árukeresö balenciaga 2017 shoes balenciaga 2017 shoes cheap jordan 4ta, I had found that I wrote the code exactly the same, over and over I had found no reading was detected in the code. After several attempts at recompiling, changing the baud rate of the serial monitor, changing how often it reads a frequency, I was about to consider only using amplitude to read sound values… at least this was the case until I noticed yeezy shoes for sale bauchtasche eastpak bauchtasche eastpak westerm kalap workout spandex shorts stetson straw cowboy hats fsu jersey westerm kalap mug bedrucken amazon blow up two person kayak chia seeds benefits for women scaffalatura cantilever Italy florida state jersey sandalias adidas rojas hombre air max 97 trainers summit white bleached desert sandone value was different.

//Before

/*for (int i = 0; i < SAMPLES; i++) {

    microSeconds = micros(); //Timer begins

    vReal[1] = analogRead(0);//Read Pin A0
    vImag[1] = 0; //Set imaginary number

    while (micros() < (microSeconds + samplingPeriod))//Begin the timer, and continue running as long as micros() is smaller than (microSeconds+samplingPeriod)
    {
      //do nothing
    }
  }*/

-----------------------------------------------------------------------------

//After
  for (int i = 0; i < SAMPLES; i++) {

    microSeconds = micros();

    vReal[i] = analogRead(0);
    vImag[i] = 0;

    while (micros() < (microSeconds + samplingPeriod))
    {
      //do nothing
    }
  }

After several hours of trial and error, I realized I had made a crucial error in data collection. When the code went to analyze data, it only put data into the first bit of code, rather than all 128 samples as the code wanted. Because I put a 1 rather than an i, the whole code didn’t know what to present as it is supposed to analyze all of the bits in the array before it gives an answer, and only having one bit filled will limit the functionality. The code was fixed to include i‘s in place of the 1’s. Following this, I tested again, and achieved the following result. This result shows a varying set of frequencies recorded over 10ms intervals, much more dynamic than the amplitude readings.

Initial Frequency Readings with the new code

After I noticed the code finally worked, I added in a few lines to read amplitude, and tested this against an audio frequency generator. While it was an accurate reading, it was not very precise, with a few outliers ranging between a 20Hz and 100Hz difference. To change this, i manipulated the sensitivity dial on the sound sensor to see if that would give me a more accurate reading. By the time I finished calibrating, the sensor was able to average to about +15Hz from the actual value. In order to mitigate what the difference, I decided to subtract 15 from the peak value to reduce this error. At this point, I managed to get the frequency values to about a +/-3 to 7Hz difference with a few outliers. If I were to make these readings more accurate, I would need a few other components to allow this. For the scope of this project, I will not be getting those components as I will likely be waiting for a long time before they arrive. While this definitely wasn’t the trickiest part of my project, this is definitely the most necessary piece, and I would have likely purchased other components if this did not work. This coming week, my plan is to find some patterns for Neo-Pixels, and test them with the Arduino and the sound sensor.

Leave a Reply