fred_france
Active member
Hello,
I would like to reverse the phase of the audio signal (180 °) to experiment around the cancellation of sounds.
I tried with a mixer to set the gain to -1 (i tried too with the amp), but the signals are not inverted as shown in the oscillogram.
(sine signal 2K700hz 1vp-p, red : input, blue : ouptut).
if i change the frequency, the offset between input and output changes, but is never 180 degrees
my code :
Do you know if there is another way?
thanks in advance
Fred (Teensy v4.0+ audio Adapter)
I would like to reverse the phase of the audio signal (180 °) to experiment around the cancellation of sounds.
I tried with a mixer to set the gain to -1 (i tried too with the amp), but the signals are not inverted as shown in the oscillogram.
(sine signal 2K700hz 1vp-p, red : input, blue : ouptut).
if i change the frequency, the offset between input and output changes, but is never 180 degrees
my code :
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s2; //xy=214,235
AudioMixer4 mixer1; //xy=547,366
AudioOutputI2S i2s1; //xy=879,224
AudioConnection patchCord1(i2s2, 0, mixer1, 0);
AudioConnection patchCord2(mixer1, 0, i2s1, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=857,517
// GUItool: end automatically generated code
const int myInput = AUDIO_INPUT_LINEIN;
//const int myInput = AUDIO_INPUT_MIC;
void setup() {
// put your setup code here, to run once:
AudioMemory(50);
// Enable the audio shield. select input. and enable output
sgtl5000_1.enable();
sgtl5000_1.inputSelect(myInput);
sgtl5000_1.volume(0.4); //
mixer1.gain(0,-1);
mixer1.gain(1,0);
mixer1.gain(2,0);
mixer1.gain(2,0);
}
void loop() {
// put your main code here, to run repeatedly:
}
Do you know if there is another way?
thanks in advance
Fred (Teensy v4.0+ audio Adapter)