Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: Perl vs Python revisited

by BrowserUk (Patriarch)
on Jan 15, 2017 at 10:20 UTC ( [id://1179589]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl vs Python revisited
in thread Perl vs Python revisited

Nice example. Thanks.

(Now you've got me sitting here wondering: Is it 2 channels (stereo) and 3 byte (24-bit) samples? And also wondering; did anyone actually ask him :)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^5: Perl vs Python revisited
by GrandFather (Saint) on Jan 16, 2017 at 01:05 UTC

    The code was somewhat faked up because I didn't have access to the details and they don't actually matter much anyway. The code is actually in a multiple channel sampling system used for biological signals. It does sample 24 bits (at around 40 kHz), but most of the signal processing is 32 bits and the final output is 16 bits (at around 120 kHz)! But to satisfy curiosity somewhat the code is currently:

    out = new RingBufferEnum(in.get(), 2 * PI * (9*5));

    The 9 is a decimation ratio. I can't remember what the 5 is (maybe an interpolation ratio?), and the 2 * PI is a fudge factor we determined by in essence profiling the code (with a logic analyser actually).

    There was extensive discussion around the buffer sizes, but at a higher "philosophical" level that didn't really touch on the magic numbers. Oh and look, here's the original code:

    //This somewhat empirical value of 4, in combination with a kMinSample +sToProcess //= 16, gives the best performance in the sense of minimizing the like +lihood of //DAC buffer underflow and ADC buffer overflow during the period just +after //sampling starting when the filters are initialising. const int kMultirateInitNumInnerSamples = 2; ... out = new RingBufferEnum::Enum( in.get(), (9*5) + 5, 9 * 5 * kMultirat +eInitNumInnerSamples);

    Note the rather worrying disconnect between 4 in the comment and the actual constant value of 2!

    The whole exercise was not a shining example of a team pulling together, but the situation was complicated by factors beyond our control.

    Premature optimization is the root of all job security

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1179589]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2024-04-18 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found