Giter Site home page Giter Site logo

openaudio_arduinolibrary's People

Contributors

boblark avatar chipaudette avatar grahamwhaley avatar idc-dragon avatar max-huster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openaudio_arduinolibrary's Issues

Cannot get examples to compile in Arduino IDE.

I hope you don't mind me contacting you like this. I am not getting the OpenAudio examples to compile. They all fail with following error message. I have tested with an Teensy 3.6 with Audio Adapter and also with an Teensy 3.2 with Audio Adapter.

/Users/slexer/Documents/Arduino/libraries/OpenAudio_ArduinoLibrary/output_i2s_f32.cpp: In function 'float setI2SFreq(float)':
/Users/slexer/Documents/Arduino/libraries/OpenAudio_ArduinoLibrary/output_i2s_f32.cpp:44:176: error: narrowing conversion of '4.41176484e+4f' from 'float' to 'int' inside { } [-Wnarrowing]
const int samplefreqs[numfreqs] = { 2000, 8000, 11025, 16000, 22050, 24000, 32000, 44100, 44117.64706 , 48000, 88200, 44117.64706 * 2, 96000, 176400, 44117.64706 * 4, 192000};
^
/Users/slexer/Documents/Arduino/libraries/OpenAudio_ArduinoLibrary/output_i2s_f32.cpp:44:176: error: narrowing conversion of '8.82352969e+4f' from 'float' to 'int' inside { } [-Wnarrowing]
/Users/slexer/Documents/Arduino/libraries/OpenAudio_ArduinoLibrary/output_i2s_f32.cpp:44:176: error: narrowing conversion of '1.76470594e+5f' from 'float' to 'int' inside { } [-Wnarrowing]

All examples form the 'original' Audio Library for the Teensy compile without any problems.

No Audio in or out on Teensy4.0 with Rev D Audio board

I've been trying to get any of the examples to produce audio to no avail. That means "it's me" but I'm not sure what I'm doing wrong. I have a Teensy 4.0 with the Dev D audio board. The interface pins are different https://www.pjrc.com/store/teensy3_audio.html from the previous version, but I'm unsure if that's the issue. The examples compile without error but no audio paths appear to be working or at least I cannot get audio out the headphone jack. The stock PJRC audio library works so I know my card is functioning properly and the Arduino IDE is configured.

AudioSynthWaveformSine_F32, stereo I2S output to DAC out-of-phase @ sample rate 44100 & 44117 Hz

S/W: Windows 10, Arduino 1.8.19, Teensyduino 1.57, OpenAudio library up to and including commit 88126e2.
H/W: Teensy 3.2 plus PCM5102A DAC.

While playing with the OpenAudio library generating a sine wave, I noticed that for sample rates 44100 & 44117 Hz, the sine output is out-of-phase.
Here is the code used:

#include "OpenAudio_ArduinoLibrary.h"
#include "AudioStream_F32.h"
#include <Audio.h>

// T3.x supported sample rates: 2000, 8000, 11025, 16000, 22050, 24000, 32000, 44100, 44117, 48000,
//                             88200, 88235 (44117*2), 95680, 96000, 176400, 176470, 192000
// T4.x supports any sample rate the codec will handle.

const float sample_rate_Hz = 32000,0f;
const float freq = 1000.0f;
const int   audio_block_samples = 128;

AudioSettings_F32 audio_settings(sample_rate_Hz, audio_block_samples);

AudioSynthWaveformSine_F32    sine1(audio_settings);           
AudioOutputI2S_F32            audioOutI2S1(audio_settings);         
AudioConnection_F32           patchCord1(sine1, 0, audioOutI2S1, 0);
AudioConnection_F32           patchCord2(sine1, 0, audioOutI2S1, 1);

void setup() {
  AudioMemory(20);
  AudioMemory_F32(20);
  sine1.amplitude(1.0);
  sine1.frequency(freq); 
  sine1.begin();
}

void loop() {
}

Output on scope at SR = 32000 Hz:
SDS00073

Output on scope at SR = 44100 Hz:
SDS00074

Output on scope at SR = 44117 Hz:
SDS00075

Output on scope at SR = 48000 Hz:
SDS00076

The logic analyzer on the I2S signals also shows different L&R samples at 44100 & 44117 Hz.

Paul

FFT sizes greater than 512 cause the Teensy to crash.

When using the formant shifter setting sample size greater than 128 (256) which equates to 512 in the FFT size the Teensy crashes when trying to create the FFT object?

This is on a teensy 4.0 oveclocked to 712mhz

Is 512 the max I can get?

Public connect and disconnect methods for AudioConnection_F32 class

Thank you for the excellent library!
The AudioConnection class that comes as a part of the Teensy Audio Library has connect and disconnect methods allowing one to reroute AudioConnections (PatchCords) as seen here . These are missing in the AudioConnection_F32 class and I was wondering if they could be added…
Thank you!

AudioSettings_F32 audio_settings, sample_rate_Hz fixed to 44117 Hz?

While playing with the OpenAudio library on a Teensy 3.2 plus PCM5102A DAC to be used as a sine wave generator, I noticed that setting the sample_rate_Hz did not have an effect. I tried 48000 Hz and 96000 Hz.
Here is the code used:

#include "OpenAudio_ArduinoLibrary.h"
#include "AudioStream_F32.h"
#include <Audio.h>

// T3.x supported sample rates: 2000, 8000, 11025, 16000, 22050, 24000, 32000, 44100, 44117, 48000,
//                             88200, 88235 (44117*2), 95680, 96000, 176400, 176470, 192000
// T4.x supports any sample rate the codec will handle.

const float sample_rate_Hz = 96000.0f;  // logic analyzer shows LRCK 44100 Hz, bit clock BCLK 2.82 MHz
const float freq = 1000.0f;
const int   audio_block_samples = 128;

AudioSettings_F32 audio_settings(sample_rate_Hz, audio_block_samples);

AudioSynthWaveformSine_F32 sine1;
AudioOutputI2S_F32         audioOutI2S1;
AudioConnection_F32        patchCord1(sine1, 0, audioOutI2S1, 0);
AudioConnection_F32        patchCord2(sine1, 0, audioOutI2S1, 1);

void setup() {
  AudioMemory_F32(20);
  sine1.amplitude(1.0);
  sine1.frequency(freq * 44117.647f / sample_rate_Hz);  // this shows ~460 Hz on oscilloscope, phase shifted
}

void loop() {
}

The logic analyzer shows this for the I2S signals:
LA
As you can see the LRCK is ~44110 Hz.
From the logic analyzer data I observed that audio data is 16 bits. How do increase that to 20 or even 24 bits?

I also noticed the sine output is phase shifted, although the mono sine source AudioSynthWaveformSine_F32 is just splitted to the L & R signals:
SDS00070
On the logic analyzer image you can also see that the left & right datablock is different within each LRCK sample.

Environment: Windows 10, Arduino 1.8.19, Teensyduino 1.57, Teensy 3.2, OpenAudio library up to and including commit 88126e2.

Regards,
Paul

RFC: Adding spectral noise reduction class

This is not so much an Issue, as an RFC and note of intent.

I'm in the process of adding a Spectral noise reduction class to the OpenAudio library.
I've made a start, and have something working, but it needs refinement, some interface improvements, and documentation.

The work is based on the code you can find in the Convolution-SDR and UHSDR - see:

A partly 'sanitized' version of the code can be found in the DSPham code base: https://github.com/grahamwhaley/DSPham/blob/master/spectral.cpp , but even that has a bunch of code that needs cleaning, documenting or removing (there is some old code and data blobs that are legacy from other previous NR data schemes from long ago in the code history).

The best introduction to how the code works can be found in the UHSDR wiki: https://github.com/df8oe/UHSDR/wiki/Noise-reduction

I've got some other stuff to do, so it may be a few weeks yet before I polish it enough for an initial PR.

Example won't compile until "#include "DSP_Teensyduino_32.h" removed- then works fine

Great work on this F.P. audio library, Chip.
I'm using Arduino 1.8.9 and Teensyduino 1.52. Until I remove the #include "DSP_Teensyduino_32.h" line from the TestEqualizer1 example, it won't compile. I don't see this file in the OpenAudio_Arduino library, so its not surprising. Compiles and works great without that line though. Am I missing something, or should the examples be edited to reflect this?
DD4WH and I have written floating point Convolution FIR filters using (FFT/iFFT) including segmented FFT routines that have very ow latencies even on FIR tap lengths up to 20K (for guitar cabinet simulation, for example). DD4WH did most of the original coding, and I ported it to a conventional PJRC audio library object and swapped in CMSIS routines for most all the processing. While the filter only accepts 16-bit stereo input/output, all the processing is in floating point, including of course the FIR coefficients.
In the past, I had tried to implement a multiband EQ using our routine and 513 tap FIR coefficients. In theory, I figured I should be able to add the filter coefficients for each individual band together, but it worked poorly. When I came across your work, I could see that you also calculate the individual filter coefficients but use a window function, which I didn't. When I use your equalizerNew routine to calculate the FIR coefficients, it looks like our filter is now working very nicely.
I'm using Teeny 4.0 and 4.1, and it sounds like your openAudio library is not completely running on them yet. But, in the future I'd like to make use of your floating point Audio library further.
Many thanks

SineCosOut.ino example not compiling for Teensy 3.2

When trying to compile the SineCosOut.ino example for Teensy 3.2, compilation failed with the following error:

_C:\Users\Paul\Documents\Arduino\libraries\OpenAudio_ArduinoLibrary/AudioFilterConvolution_F32.h:107:31: fatal error: arm_const_structs.h: No such file or directory
compilation terminated._

Found an instance of arm_const_structs.h in C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4.
But this file is not present in C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3, hence the compilation error.

Environment: Windows 10, Arduino 1.8.19, Teensyduino 1.57.

Regards,
Paul

Teensy 4.0 compatibility

Not an issue as such - just wanted to say thank you for this library, I had a great time experimenting with it on the Teensy 3.6. Just wondering if the library will be updated for Teensy 4.0 compatibility?

I was working on an effects processor on the 3.6 but in my code I get some errors that i'd love to help with if it's in my capabilities but not sure where to start and not sure of how big a change in core architecture the 4.0 has introduced.

If I could help in any specific way just let me know and thanks again for the excellent library!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.