Noise on quiet sounds with Teensy 3.2

Status
Not open for further replies.

Kexikus

Member
Hello everyone,

I've been working on a space gun prop project with light and sound both powered by a Teensy 3.2. All of that has worked pretty much flawlessly both when testing the individual components on a breadboard and in the soldered prototype I just finished.

However, there has been one persistent issue that I can't seem to get rid of and that's some kind of noise that can be heard whenever the currently played sound is on the quieter side. You can kinda here it in this video whenever one of the shot sequences ends. Instead of fading out properly, there's a noise that cuts off once the sound file ends.


I've tested this with multiple amplifiers and speakers and as far as I can tell, they're not to blame, which leaves me wondering what else I can do to fix this. I also know that it's not part of the wav-file. I've also attached that to this post just in case anyone wants to have a look.

View attachment AudioFiles.zip

The amplifier is powered from the 3.3V of the Teensy and grounded to the Teensy GND as well. The signal input is connected to the Teensys DAC through a 10uF capacitor with the - pole facing the amplifier.

I'd be very grateful for any suggestions on what I can do to fix this as it does detract from the overall quality quite a bit. As a note: I don't have a lot of space, which is why I'm not using the Audio shield even though that might improve things. I'd prefer to keep it that way but if necessary I could check if it's somehow possible to fit the shield into my prop.

Thank you :)
 
How is the amplifier ground connected? Does it have separate inputs for power ground and signal ground (or signal negative)?

These sorts of problems are often ground current (or "ground loop") related.
 
It has separate inputs but currently I only have the power ground connected. I tried connecting the signal ground as well though and that changed nothing.

There is quite a lot connected to ground though with all the other hardware pieces, so there might very well be some kind of loop. It does happen with all of these pieces removed as well though.
 
Try connecting a dedicated wire from the amp's signal ground directly to the AGND pin on Teensy. Leave the amp's power ground connected to the regular ground wires, which should connect to the GND pins on Teensy, but not to AGND. Keep the AGND pin dedicated only for the analog signal ground.
 
Can't see an edit button so I guess I'll just add this in a new post. Here's a photo of my current wiring with comments about the relevant parts for this issue. Let me know if you need more information.

MVyRsLQ.jpg

As another note: The yellow wires attach to the SD card reader and pins 10, 11, 12 & 13 on the Teensy 3.2.
 
Is it running on battery power only? If not, could help.

Could be the microSD card. It's a big power draw and can induce noise in my experience, although I've only worked with writing to microSD card (reading I would expect to be less prone to noise). Maybe running the sdcard off a different battery to test?
If your sounds can fit on SPI flash, that's a way to avoid the microsd if that's the problem.
 
Thanks for the suggestion. The files are quite small so they should fit on the SPI flash. I do have some problems with that though.

I have a Teensy 3.2 and if I'm not mistaken it should have a flash memory. But I can't seem to access it. I tried using TeensyTransfer but when I try to get information about the flash memory all I get is
Code:
ID    : 00 00 00
Serial: 00 00 00 00 00 00 00 00
Size  : 0 Bytes

and trying to write a file results in a Communication error.

I also tried and ran the RawHardwareTest example from the SerialFlash library after running the EraseEverything but that resulted in the following:

Code:
Raw SerialFlash Hardware Test

Read Chip Identification:
  JEDEC ID:     0 0 0
  Part Nummber: (unknown chip)
  Memory Size:  0 bytes

Tests Failed  :{

The flash chip may be left in an improper state.
You might need to power cycle to return to normal.

So it seems like I'm doing something very wrong. Any ideas what that might be?

Also, I'll try the suggestion of using a second battery for the SD reader later.

Edit: Uhm yeah, I guess all of the above is not what you were talking about. Instead I now used wav2sketch and the audio player from memory without using the SD card. That got rid of all the noise, so it was probably caused by the SD card. And since getting rid of hardware is certainly a good thing as I don't have a lot of space in my prop, I'll gladly go with this method. Now I just need to figure out why one of my sounds doesn't convert properly.

Edit 2: Seems like there was something wrong with the .wav file. Reexporting it from Audacity fixed the issue and all sounds are playing now. There is still a tiny bit of noise but I guess that's now an artifact from converting the .wavs to be part of the sketch. I'll see if using RAW files from the prop board memory has any benefit once the board arrives. In any case, thank you very much for the help :)
 
Last edited:
Glad you are making progress. How does the audio sound in audacity? After converted?

You can silence or fade the end of the sample in audacity. Pick a zero-crossing to start and end anything you silence/fade. Maybe frequency filters would help. Maybe you could do a mic recording of the audio that has noise coming out of your prop, and look at the frequencies in audacity.

This is a handy SPI flash if you need more storage: https://www.tindie.com/products/onehorse/spi-flash-memory-add-ons-for-teensy-3x/
 
Sorry for the late reply and thanks for your suggestions.

My prop shield has now arrived and I tried playing both the .raw files and the sounds directly from the sketch with the prop shield amplifier and both result in the same tiny amount of noise that I had before when playing from sketch with my external amp.

I also checked the raw audio in Audacity and it sounds just fine. No noise there. I wouldn't know how to check the "sketch audio" with Audacity though. But since both have the same noise, I'd assume that it's coming from somewhere else.

I don't quite understand your suggestion about fading the sample and the zero-crossings. The sound does already fade in the end. I will try and get a recording however. Maybe I can figure out the noise frequencies.
 
Status
Not open for further replies.
Back
Top