Refactor delay calculation#7
Merged
Merged
Conversation
The function would check if the max value was greater than 0 and if it was then it would scale the input array and return if. If the input is all zeros, the scaled array would never be created but it would still try to return it. Changed to if the input is all zeros it just returns the input
…nctions in ofdm package
This is the current way that the data needs to be unpacked when using the parabolic interpolation delay calculation method.
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.
Summary
Refactored the code handling the matched filter delay calculation and interpolation for sub-sample delay. Additionally. developed tests for the delay calculations.
upsample(),scale_rx_signal(),calculate_sub_sample_delay_parabolic(), andcalculate_sub_sample_delay_zp()from script-level definitions intosrc/ofdm/channel/delay.pycalc_delay.pyis now pure orchestration file I/O, argparse, and calling package functionsconftest.pywith shared session-scoped fixtures to eliminate repeated setup across test filesWhat changed
src/ofdm/channel/delay.pyupsample()FFT-based signal upsamplingscale_rx_signal()normalizes signal amplitude to 0.9 maxcalculate_sub_sample_delay_parabolic()sub-sample delay via parabolic interpolationcalculate_sub_sample_delay_zp()sub-sample delay via zero-padded FFT interpolation_correlate()internal helper shared by both delay estimatorsscripts/delay/calc_delay.py.append()call in theelsebranch ofmain()parse_args()now called before loading config filestests/conftest.pycfg,active_bins,pilot_vals,pilot_symbol_freq,data_symbol_freq,pilot_symbol_time,data_symbol_time,generatortests/test_delay.pyTestUpsample,TestScaleRxSignal,TestCalculateSubSampleDelayParabolic,TestCalculateSubSampleDelayZPscale_rx_signal()raisedUnboundLocalErroron zero input fixed