Page 1 of 2
Espressif DSP Library help
Posted: Thu Nov 30, 2023 6:17 pm
by mikemoy
Our native DSP guy got canned last week. So I got stuck with finishing up his project. YEA!!!
Don't know jack about DSP, learning as fast as I can. I need to sample a audio source from 200 - 20k.
So far I am able to pull in 4096 bytes from my 12bit external a/d converter with a sample rate of 40960.
I do NOT want to use anything arduino related to do this just IDF & Espressif DSP Library. I have pulled in the Espressif DSP Library into the project, and thats where the fun stopped because even with the examples there I have no clue how to get my buffer to work with any of those examples.
If anyone has any tips I would appreciate it.
Re: Espressif DSP Library help
Posted: Thu Nov 30, 2023 6:51 pm
by MicroController
Re: Espressif DSP Library help
Posted: Sun Dec 03, 2023 7:38 am
by mikemoy
Thanks, that is where I started. But it's clear as mud to me as for how I inject my data.
Re: Espressif DSP Library help
Posted: Sun Dec 03, 2023 11:38 am
by MicroController
If you cannot even figure out which of the supported data types fits your requirements and how to create an array of this type with your data in it to pass to the DSP functions, then your boss has a problem now.
Re: Espressif DSP Library help
Posted: Sun Dec 03, 2023 6:15 pm
by mikemoy
If you know so much about it wouldn't it have been better to shed some light than to make a comment like that ?
That's why its called learning.
Re: Espressif DSP Library help
Posted: Sun Dec 03, 2023 7:59 pm
by MicroController
Yeah, I'd gladly help. But given that you did not even hint at what you're trying to do, or what you have tried, or where the existing documentation may not be clear, or what else specifically the problem could be, that's kinda hard.
Besides the ranting about your job, all I gathered from your question is 'I have a bunch of values of some unspecified type in memory and I don't know how to pass these values to some unspecified function, and it's about DSP'. Did I miss something?
Your frustration with having to pick up someone else's half-finished work is understandable, and that you're less than highly motivated to do so a.t.m. is obvious. Which makes me not actually believe that you don't know how to pass an array to a function in C...
My suggestion would be to process the situation a bit and try and calm down. If you can do that, it's going to be possible & easier to get back to some more constructive state of mind, which may be required to get along with other people's mess.
Re: Espressif DSP Library help
Posted: Mon Dec 04, 2023 3:17 am
by mikemoy
FWIW, The company decided way to late to attend a show in Jan. They decided to make a new product in 2 months. I have 1/2 of the project and the DSP guy had the other 1/2. I have been already working 16-18 hour days for weeks now just on my 1/2. So to now have the other 1/2 given to me with the current time I am already putting in is difficult. Normally this would not bother me but its just the wrong time to be learning something totally new which just compounds the issue.
What I need to accomplish is to sample an audio source from 200 - 20k, and to display that in a EQ style fashion. I have designed the A/D circuit to do this. The A/D converter is 12-bit, and I am reading the samples into a circular buffer of 4096. The A/D converter max is 2.5v and the the Vref is set to 1.25v. The confusing part for me is I don't know what the DSP function expects as data.
Is it looking for 0 to 4095, where 0 is no audio, or in my case no audio is going to give 2048, and a negative full swing will be 0, and positive full swing will be 4095.
I have looked at and just tried the DSP examples, but it's just not clear to me how to pass my data buffer to what function, and/or if I need to alter my data first to fit what the DSP is expecting for values.
Re: Espressif DSP Library help
Posted: Mon Dec 04, 2023 4:38 am
by ESP_Sprite
Have you looked for other sources of info? E.g.
this has a fair bit of info on related problems.
EDIT: Also,
this example was very recently added.
Re: Espressif DSP Library help
Posted: Mon Dec 04, 2023 4:42 am
by mikemoy
I have thank you, but its not clear to me what is the min/max values my data needs to be to pass to the functions.
Re: Espressif DSP Library help
Posted: Mon Dec 04, 2023 6:42 am
by ESP_Sprite
Seems pretty trivial to me: the functions take int16_t types and you can see that that example directly reads out the codec at 16bit per sample, and I2S data is signed so the range would be -32768 to 32767. You could also shove your 0-4096 values in directly if you prefer, but you'd get a DC bias (which you could get around by discarding the 1st bin of the resulting FFT) and lower output values (which may or may not be a problem).
(If you don't mind me commenting, it feels like you have a bit of weaponized helplessness here. 'I got this shoved on me, so I won't lift a finger more than I need to fix this': looking on how you comment on the rest of this forum, you seem generally intelligent and knowledgeable enough that you normally could figure this out. That attitude is understandable given what happened, but it's usually not a very good sign. I hope you're planning to have a good hard and long talk with management about this afterwards, and if not hope you're polishing your resume. If any, take care of yourself; from what I know you kinda risk burning out in situations like this.)