Comments (4)
Your overall approach sounds fine. Step one is definitely to verify the data you're getting from mic_stream. You definitely shouldn't be seeing NaNs, so I suspect the mic data is bad.
Coincidentally I recently worked on a project that streamed microphone data through STFT, and I ran into similar issues. To verify the microphone data you'll need to find some way of playing the audio. In my case I saved the audio chunks to WAV files on my phone, then copied then to my computer so I could look at the sample data directly.
I also started out my project using mic_stream, but I ran into all sorts of issues. For example, I was using 16-bit PCM and I found that the 2 bytes in each sample were the wrong way around, so I had to manually decode it. After a lot of troubleshooting I eventually got the audio to sound ok, but there was a weird clicking sound in the chunks. Turned out that the first few samples in each chunk I received from the microphone were 0. At that point I gave up and switched to flutter_audio_capture.
from fftea.
Hey, thank you so much for your helpful advice!
I was able to get non-NaN values by using FFT instead of STFT, as I only needed to detect peaks FFT is sufficient. Your suggestion about using mic_stream was also very useful. I switched to using flutter_audio_capture
and it's now working perfectly. Thanks again!
from fftea.
@Clon1998 glad you got it working. I'm a bit concerned that you were getting NaNs with STFT
but not FFT
though. Sounds like a bug in my code. Are you able to figure out the input data that does this and post it here?
from fftea.
@Clon1998 glad you got it working. I'm a bit concerned that you were getting NaNs with
STFT
but notFFT
though. Sounds like a bug in my code. Are you able to figure out the input data that does this and post it here?
I need to double check. But I think I also got NaN values while using the 32 BIT Float PCM encoding. After switching to 32 Bit PCM (int) I got normal values.
from fftea.
Related Issues (20)
- Add benchmarks to CI
- Propose to merge with SciDart HOT 4
- Stein's algorithm
- Not an issue, just a question HOT 1
- Opengl accelerated HOT 2
- How to split range in frequency domain and inverse FT? HOT 6
- Add inverse of discardConjugates function HOT 1
- Streaming API for STFT
- `primePaddingHeuristic` is inefficient
- Found Key & BPM from Audio byte HOT 3
- Audio resampling util? HOT 1
- Pitch Shift using FFT? HOT 6
- Gaussian Window HOT 24
- How to compare two wav file? HOT 4
- Investigate changing order of operations in `CompositeFFT`
- Doc for example
- Some example code HOT 1
- How can I use this plugin to get volume and frequency? HOT 3
- How do I convert the raw data obtained by the microphone into the data required for the spectrogram? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fftea.