Chk/downsampling: do_cic() with fixedpoint intern, update downsampling_test.py#21
Open
ohrenschmaus wants to merge 21 commits into
Open
Chk/downsampling: do_cic() with fixedpoint intern, update downsampling_test.py#21ohrenschmaus wants to merge 21 commits into
ohrenschmaus wants to merge 21 commits into
Conversation
- test cic against fir - test cic_all_values - test cic_first_value - test is_power_of_two
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
Keep chk/downsampling version: analytical tests with _fir_cic_ref instead of golden-data arrays from main. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- downsampling.c: use last_even_prev/last_even (even-indexed samples) instead of last_ls/last_hs to correctly compute FIR [1,2,1] output[k] = uin[2k+1] + 2*uin[2k] + uin[2k-2] - downsampling_test.py: replace 20000-entry golden data in test_polyphase_two with analytical first-value check; fix setUp to use sampling_rate=40e3 and freq=[4,400] after merge regression Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- add c/downsampling_simple_template.h - change src/c_compile/__init__.py - add src/c_compile/simple.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Um Rundungsfehler klein zu halten habe ich die den internen cic-Algorithmus auf fixedpoint-Typen umgestellt. Das ist kein Problem, da dort nur addiert und subtrahiert wird. Am Ende werden die Werte wieder auf np.floats umgewandelt und ausgegeben. Die Rundungsfehler sind mit np.float nicht extrem groß, fallen aber bei der Umsetzung auf C-floats(32bit) stark ins Gewicht.
Da ein CIC-Filter mit 'num_stages' Stufen und Dezimationsfaktor 'dsr' mathematisch identisch mit einem FIR-Filter mit einem Rechteckimpuls der Länge 'dsr', der 'num_stages' mit sich selbst gefaltet wird, ist, wird do_cic() nicht mehr gegen einen Goldwert sondern gegen einen fir-referenz-Array.
Neue Testfunktionen:
der Test test_cic() fällt raus.