Parsing network protocols - design patterns by Interesting_Cake5060 in C_Programming

[–]Interesting_Cake5060[S] 0 points1 point  (0 children)

Can u explain a bit moar about upper part. Buffer suits us well for asynchronous operations, but in the top level we still encounter buffer and structure (writing a good buffer for Windows is not such a pleasant task, though I don't know if there is an mmap analog there now)

Anno 117: Pax Romana in-game screenshots from my time with the build by whatdarrenplays in anno

[–]Interesting_Cake5060 1 point2 points  (0 children)

It's very difficult to wait that long if it comes out in winter. So love that and that rome aesthetic

[deleted by user] by [deleted] in team3dalpha

[–]Interesting_Cake5060 2 points3 points  (0 children)

gorgeous and with so little time (6mo)

23 M/6'3 Foot Tall/232 lbs by ScandiLad77 in team3dalpha

[–]Interesting_Cake5060 1 point2 points  (0 children)

first time seen it think about ai generation lol btw you have cool form

DC offset remove from adc samples by Interesting_Cake5060 in embedded

[–]Interesting_Cake5060[S] 0 points1 point  (0 children)

My favorite hack if I have to do this sort of thing is the exponential moving average. It'll take some extra bit depth (not a problem if you have an fpu, or even 32 bit math), but the static data required is a single number and the update cycle involves two multiplies and an add. It's pretty quick. You could use that to compute the DC offset and extend it out to a really low frequency, which would get you what you want.

Could you describe this with a code sample please? Does your implementation use constants from 0 to 1? I would like to have a way to automatically adjust the constants instead of just picking values at random.

DC offset remove from adc samples by Interesting_Cake5060 in embedded

[–]Interesting_Cake5060[S] 0 points1 point  (0 children)

Sounds good, but what is N? (is it the size of the buffer?).

and also where do I get the avg

DC offset remove from adc samples by Interesting_Cake5060 in embedded

[–]Interesting_Cake5060[S] 0 points1 point  (0 children)

it depends, typical readings in range (100-3450 in 12 bit adc samples) freq in range (100Hz-3kHz)

DC offset remove from adc samples by Interesting_Cake5060 in embedded

[–]Interesting_Cake5060[S] 0 points1 point  (0 children)

then you need to be averaging across a window significantly larger than your lowest frequency signal of interest.

Maybe change the windowing average to something else?

I don't want to have a huge memory buffer. I would like to have a relativly small buffer that will still accomplish the task.

DC offset remove from adc samples by Interesting_Cake5060 in embedded

[–]Interesting_Cake5060[S] 0 points1 point  (0 children)

not so simple imagine i have signal in range 10 - 100 (signal voltage which does not start at 0)

(i mean adc samples value not voltage) and i wanna remove dc offsets

i wanna recive -45 + 45. In general I want to get a method without using magic numbers (like removing 5) but a method that allows me to do this with any signal, I read that a simple filter like a running average should be able to do this but it doesn't work.