If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
spectral vs time domain.
12 posts
• Page 1 of 2 • 1, 2
spectral vs time domain.
I have a problem to solve. If I have a beating sound, made of 2-4 FFT (sine like) components (= slightly irregular envelope, beating speeds unknown) that fades out (not linearly) - I'd like to draw (measure) a curve that follows peak (or average? or peak?) values of that fade out.
Sometimes the beating sound may be made of 2 FFT components, producing 0.2Hz beating. So - how to approach it, to get theoretical curve points in selected points of time? Some sort of envelope follower? Some sort of FFT band recalculation at some sort of resolution?
Martin? KG?
Sometimes the beating sound may be made of 2 FFT components, producing 0.2Hz beating. So - how to approach it, to get theoretical curve points in selected points of time? Some sort of envelope follower? Some sort of FFT band recalculation at some sort of resolution?
Martin? KG?
- Attachments
-
- curve.png (21.71 KiB) Viewed 15191 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: spectral vs time domain.
The easiest would be to take an envelope follower with a decay time long enough to average out the beating but short enough to follow the fade-out of the sound. (In your graph the beating appears to be much quicker than the fade-out.)
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: spectral vs time domain.
That was an example.
I'm trying to make some sort of analyzer for an instrument (singing bowl).
Basically, the instrument's output is/should be split into multiple, narrow FFT bands (few up to 16). I'm not sure if this can be doable correctly in FS due to lack of resolution (vs performance), but band features can be provided externally from other app, where measurements are made at 128-512kpts (measurements for different purposes).
Anyway, after the sound is split into bands, each band contains 1-4 sine like stable peaks (constant frequency). Now - if some of these peaks are very close, it produces very slow beating, like 1 to even 5 seconds per cycle. But peaks can be far enough from each other and in bi-pair configurations - envelope is more "stable" so to speak.
Now the tricky part. The instrument's fade out speeds (per band) depend on environmental factors, and of course they differ from instrument to instrument. So what I'd like to measure - are time points (like 0.3, 4, 8, 12, 16s) for each band, and use it as a starting point for further work. But. If I use envelope - then at slow beats I would rather need to "reconstruct" the theoretical envelope according to peaking of the beat. If I use FFT sub-arrays (per band) - I could probably (at least this is how I undetrstand it) determine/predict the peak amplitude for selected time points. So I came to conclusion, that maybe a way would be to use FFT data per band to calculate/predict the wave theoretical max peak value at time points? Sort of.
I'm trying to make some sort of analyzer for an instrument (singing bowl).
Basically, the instrument's output is/should be split into multiple, narrow FFT bands (few up to 16). I'm not sure if this can be doable correctly in FS due to lack of resolution (vs performance), but band features can be provided externally from other app, where measurements are made at 128-512kpts (measurements for different purposes).
Anyway, after the sound is split into bands, each band contains 1-4 sine like stable peaks (constant frequency). Now - if some of these peaks are very close, it produces very slow beating, like 1 to even 5 seconds per cycle. But peaks can be far enough from each other and in bi-pair configurations - envelope is more "stable" so to speak.
Now the tricky part. The instrument's fade out speeds (per band) depend on environmental factors, and of course they differ from instrument to instrument. So what I'd like to measure - are time points (like 0.3, 4, 8, 12, 16s) for each band, and use it as a starting point for further work. But. If I use envelope - then at slow beats I would rather need to "reconstruct" the theoretical envelope according to peaking of the beat. If I use FFT sub-arrays (per band) - I could probably (at least this is how I undetrstand it) determine/predict the peak amplitude for selected time points. So I came to conclusion, that maybe a way would be to use FFT data per band to calculate/predict the wave theoretical max peak value at time points? Sort of.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: spectral vs time domain.
Will the instrument be analyzed in real time? If not then there is a workaround for the envelope.
First analyze the file form backwards forward by envelope follower with infinite release time and zero attack time.
The output will be a file that contains steps of the peaks (each step expanding to the left form the peak). This will ease the work of a second envelope follower/lowpass filter to smooth the steps.
First analyze the file form backwards forward by envelope follower with infinite release time and zero attack time.
- Code: Select all
streamin in;
streamout out;
out=max(out,abs(in));
The output will be a file that contains steps of the peaks (each step expanding to the left form the peak). This will ease the work of a second envelope follower/lowpass filter to smooth the steps.
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: spectral vs time domain.
No, not realtime. I usually record c.a. 30-40 seconds long files.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: spectral vs time domain.
You might try to model your signal as exponentially decaying and fit the time constant. Here is a schematic that may serve as a start. I adopted KG's idea of analyzing the wave file in reverse order, searching for peaks which are greater than previous peaks. The resulting set of data points is used for a linear regression to determine the best exponential envelope fit. Hope it helps.
- Attachments
-
- DecayFit.fsm
- (1.39 MiB) Downloaded 793 times
-
- DecayFit.png (24.99 KiB) Viewed 15060 times
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: spectral vs time domain.
Thanks, I will play with it.
These are kind of sounds I deal with (see attachement). Sometimes band1 is most audible, but not always, so this is just an example. What usually happens - is the change in decay per band, and this is more interesting.
Theoretically, decay is indeed some sort of exponential fade out, I just didn't know how to approach it due to multi-peak structure.
Anyway you are amazing.
These are kind of sounds I deal with (see attachement). Sometimes band1 is most audible, but not always, so this is just an example. What usually happens - is the change in decay per band, and this is more interesting.
Theoretically, decay is indeed some sort of exponential fade out, I just didn't know how to approach it due to multi-peak structure.
Anyway you are amazing.
- Attachments
-
- sb-example.rar
- (1.55 MiB) Downloaded 900 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: spectral vs time domain.
Question. Is it possible to re-make that envelope follower, so that it covers rather whole audio content instead of crossing it? Audio pass through was made on files attached in earlier post.
p.s. there should be no problem with infinities on the beginning. Basically, the first "measure point" starts at around 0.3 to 0.5 seconds after hit, to remove the "hit" part.
p.s. there should be no problem with infinities on the beginning. Basically, the first "measure point" starts at around 0.3 to 0.5 seconds after hit, to remove the "hit" part.
- Attachments
-
- b.png (12.29 KiB) Viewed 14990 times
-
- a.png (11.3 KiB) Viewed 14990 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: spectral vs time domain.
After some on-sound experimentation and comparisons, I'm getting to a conclusion, that maybe I will take the old approach for this topic.
Basically, single step would be like this.
1) Load wave file
2) Perform the analysis (use left channel only - should probably work with mono and stereo):
A) Add offset (like 0.3 to 0.5 sec)
B) With this offset:
- get max amplitude of a wave file in range1 (0sec to 4sec)
- get max amplitude of a wave file in range2 (4sec to 8sec)
- get max amplitude of a wave file in range3 (8sec to 12sec)
- get max amplitude of a wave file in range4 (12sec to 16sec)
- get max amplitude of a wave file in range5 (16sec to 20sec)
We assume, that the audio file will be always 21+ seconds long.
How to make it (get amplitude values in specified points of time) with this offline analyzer stuff?
Basically, single step would be like this.
1) Load wave file
2) Perform the analysis (use left channel only - should probably work with mono and stereo):
A) Add offset (like 0.3 to 0.5 sec)
B) With this offset:
- get max amplitude of a wave file in range1 (0sec to 4sec)
- get max amplitude of a wave file in range2 (4sec to 8sec)
- get max amplitude of a wave file in range3 (8sec to 12sec)
- get max amplitude of a wave file in range4 (12sec to 16sec)
- get max amplitude of a wave file in range5 (16sec to 20sec)
We assume, that the audio file will be always 21+ seconds long.
How to make it (get amplitude values in specified points of time) with this offline analyzer stuff?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: spectral vs time domain.
It looks, that this one works?
Question: if stereo wave file is loaded, then how it is represented after mem to array of floats conversion? Interleaved values?
Question: if stereo wave file is loaded, then how it is represented after mem to array of floats conversion? Interleaved values?
- Attachments
-
- gains-002-temp.fsm
- (2.57 KiB) Downloaded 776 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
12 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 70 guests