Hi everyone! I have searched high and low and simply cannot figure out how to fix this problem. My ultimate goal is to run FFT on I2S audio input from a BC127 Bluetooth module. I am able to get Teensy to accept the I2S input, but the output appears to have clipping (I'm not sure if that's the right term, distortion on lower-range sounds).
My setup is wired thus:
Please note that this setup does not use an audio shield, though I did try on another Teensy 3.6 with an audio shield and the results were the same.
I have also tried the following combinations with the following results:
Given that the BC127 appears to be producing undistorted audio and that the Teensy is capable of producing undistorted audio via I2S and DAC outputs, it seems like something is happening when the BC127 passes the I2S signal through the Teensy.
Code:
I tried to include photos of the setup and a sound clip of what I'm talking about, but they were all rejected for some reason. I want to emphasize that I'm not sure that "clipping" is the right description, but there's distortion that sounds like it's too loud when there is a low/bass tone, though the mid- and high-ranges seem to come through well.
I'm running on Windows 7 64-bit and running Teensyduino v1.42.
This is the final step in a long project so I look forward to any help you're able to offer! Thank you very much in advance!
Edit: I should note that when I say I can get undistorted I2S from the BC127, it seems to require me to hold the amp at a particular angle to the BC127. If I don't, the audio becomes severely distorted or cuts out entirely. However, when the BC127 is feeding audio to Teensy, I can move them relative to each other while the signal is still strong except for the problematic distortion.
My setup is wired thus:
- BC127 OUT/MOSI -> Teensy 3.6 Pin 13
- BC127 CLK/CLK -> Teensy 3.6 Pin 9
- BC127 SYNC/CS -> Teensy 3.6 Pin 23
- BC127 SPI/PCM -> Teensy 3.6 Pin 33 (written low to select PCM/I2S mode over SPI)
Please note that this setup does not use an audio shield, though I did try on another Teensy 3.6 with an audio shield and the results were the same.
I have also tried the following combinations with the following results:
- BC127 Analog out: undistorted
- BC127 I2S out: undistorted
- Teensy 3.6 Guitar sample I2S out: undistorted
- Teensy 3.6 Guitar sample DAC out: undistorted
Given that the BC127 appears to be producing undistorted audio and that the Teensy is capable of producing undistorted audio via I2S and DAC outputs, it seems like something is happening when the BC127 passes the I2S signal through the Teensy.
Code:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=289,390
AudioMixer4 mixer1; //xy=491,409
AudioOutputAnalogStereo dacs1; //xy=654,403
AudioConnection patchCord1(i2s1, 0, mixer1, 0);
AudioConnection patchCord2(i2s1, 1, mixer1, 1);
AudioConnection patchCord3(mixer1, 0, dacs1, 0);
AudioConnection patchCord4(mixer1, 0, dacs1, 1);
// GUItool: end automatically generated code
void setup() {
pinMode(33, OUTPUT);
digitalWrite(33, LOW);
// Audio connections require memory to work. For more
// detailed information, see the MemoryAndCpuUsage example
AudioMemory(12);
mixer1.gain(0, 0.15);
mixer1.gain(1, 0.15);
mixer1.gain(2, 0);
mixer1.gain(3, 0);
}
void loop() {
}
I tried to include photos of the setup and a sound clip of what I'm talking about, but they were all rejected for some reason. I want to emphasize that I'm not sure that "clipping" is the right description, but there's distortion that sounds like it's too loud when there is a low/bass tone, though the mid- and high-ranges seem to come through well.
I'm running on Windows 7 64-bit and running Teensyduino v1.42.
This is the final step in a long project so I look forward to any help you're able to offer! Thank you very much in advance!
Edit: I should note that when I say I can get undistorted I2S from the BC127, it seems to require me to hold the amp at a particular angle to the BC127. If I don't, the audio becomes severely distorted or cuts out entirely. However, when the BC127 is feeding audio to Teensy, I can move them relative to each other while the signal is still strong except for the problematic distortion.
Last edited: