[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4758: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4759: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
Open Music Labs Forums • View topic - FHT arduino and HT1632c

FHT arduino and HT1632c

FHT arduino and HT1632c

Postby tj_thornsberry » Tue May 21, 2013 12:26 pm

tj_thornsberry
 
Posts: 4
Joined: Tue May 21, 2013 12:14 pm

Re: FHT arduino and HT1632c

Postby guest » Tue May 21, 2013 11:51 pm

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: FHT arduino and HT1632c

Postby guest » Wed May 22, 2013 12:08 am

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: FHT arduino and HT1632c

Postby tj_thornsberry » Wed May 22, 2013 1:49 am

Yes, I am putting audio into Analog 0, I don't have the correct parts for a standalone audio circuit yet so for now its just running off a amplified headphone port on my external sound card. I am also checking the input on the Pure Data thing and the noise issues aren't to bad to notice on the bottom bands.
What that code is doing is checking every time it's even, because I believe you store the real data in the evens so I was just trying to get a way to make sure I am getting the values every time its even.
I am not a expert though in c++ so I may be mistaking in some of this data.

About the speed, I know under normal circumstances it wouldn't be a noticible speed increase if I did that, but I am thinking the Ht1632 is taking a bit longer to write so for me I can tell there is a tad bit of a delay, it can also be that code to check the evens, its not the most ideal but I couldn't think of any other way.
The noise, after checking in the serial monitor, is a constant 14 for fht_log_out[0] and a 13 for fht_log_out[1] and the next ones are getting noise to but it progressivly drops so around log_out[8-9] its perty even.

I was thinking about doing a for loop, but wasn't sure if I should but the for loop outside or inside of the loop, and I wasn't even sure If I could put a loop inside a loop.
Also I was already playing with subtracting a few numbers for the noise issue :p.
And I had no clue that dividing by 15.9 and 16, make so much of a difference, that may be were some of my speed is going because I kinda rely of that part to get the info I need.
I am also in the process of changing the plotting on the LEDs so I may gain a few ms on that.

I was gonna say something else but all this typing and the fact that I am dead tired, I done forgot :/
Oh and thanks for the suggestion I will try it out as soon as I wake up tommorow, I'll redo the coding and post the results.
tj_thornsberry
 
Posts: 4
Joined: Tue May 21, 2013 12:14 pm

Re: FHT arduino and HT1632c

Postby tj_thornsberry » Wed May 22, 2013 2:13 am

Alrighty added a for loop like you suggested, ya sleep will come later, and it sped it up perty good, now I excluded the REORDER and the WINDOW and changed them to 1, off, and that fixed the noise completly, so it's some issue in there. But after all this I still got the very first, maybe it's the very last, ill check later, band at 14, so its always on.

Oh and it seems to have a flickering issue every now and then, it will go nicley for a good little bit, and flicker a couple of times, and repeat.
tj_thornsberry
 
Posts: 4
Joined: Tue May 21, 2013 12:14 pm

Re: FHT arduino and HT1632c

Postby guest » Wed May 22, 2013 2:25 am

you have to do REORDER, the FHT shouldnt be able to work without it. WINDOW isnt as critical, but the results should look nicer with it. the FHT uses both odd and even bins, as it takes in only real data. the FFT uses only the even bins, which is why the FHT is faster and uses less space, it uses all the bins.

im betting the noise issues are due to not having the audio set to the correct DC level. you should put in the circuit i linked to above. since its not at the right DC level, it has a large DC component, which are the lower bins. and, the audio is probably clipping, putting a bunch of higher harmonics in, making all the high bins go nuts. clipping will also put in harmonics way above the sampling rate, and give aliasing problems.

the /16 is critical to speeding it up.

best of luck
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: FHT arduino and HT1632c

Postby guest » Wed May 22, 2013 2:33 am

in regards to divide by 16, sometimes i dont trust the complier to do what i want it to, so i write it this way instead:

(value >> 4) // same as divide by 16
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: FHT arduino and HT1632c

Postby tj_thornsberry » Wed May 22, 2013 2:50 am

Well the REORDER is causing the noise issues, but seems to be working without the REORDER just fine, the WINDOW is making the Band 1 = 14 Band 2 = 13 and so on until around Band 8-9.
The DC level seems to be fine, I did some testing on it, only when it is turned all the way up I am getting the tinniest change. Just to be sure I tested with another stereo, and same issues with the codes. I will see about finding parts of the circuit though just incase.

And yea I now recall I started using the FFT before I decided I didn't want to and just assumed without checking, a bad habit of mine :/. The flickering I mentioned I don't mean its going crazy just seems to turn it all off starting at 0-31 and a high speed, so I assume (again) it is counting with the code, but it also maybe I am not power the HT1632 seperately so when all the lights need power it maybe dimming or shutting off some, not a big deal with low volume testing, just having got around to digging out the cord for it (mainly because my bucket of wires is so freakin tangled).

And I will be sure to change the divide by 16 thing to that.
tj_thornsberry
 
Posts: 4
Joined: Tue May 21, 2013 12:14 pm

Re: FHT arduino and HT1632c

Postby guest » Wed May 22, 2013 4:43 am

can you post up your current code, id like to figure out why REORDER is having the effect youre seeing. how are you testing the frequency response? do you have a sinewave generator that you can sweep through frequencies?

definitely try it with the circuit. if you dont find the exact values, dont worry. any 2 resistors of the same value will do the trick for the DC bias (should be 10k to 100k range, though). the capacitor can be anything from 1uF to 100uF. the 1k resistor and 15nF capacitor are not as critical. they just help roll off frequencies which are out of the sampling range.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm


Return to Software

Who is online

Users browsing this forum: No registered users and 0 guests


cron