I've been using the raspberry pi B Rev2 to control a RGB led strip containing 5050smd LED's. I've connected the strip to my raspberry pi with mosfets, one for each channel. I've also added a usb sound card to let my leds react to music. My amp and raspberry pi are connected to the input source via an audio splitter.
When I control the lights via PIGPIOD and set the LED's at full brightness, everything is fine and no noise is heard. However, when I set them at a lower brightness, for example with the command
the corresponding color dims but a high pitched noise is emitted from the speakers connected to my amplifier. This is very annoying, as the software I use to let my LED's dance (LightshowPi) uses pwm fading to dim the LED's rather then switching them off entirely to create a nicer looking effect.
Is there any way to eliminate this high pitched noise? I've added a basic schematic to show what my setup looks like.
Thanks in advance!