Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/m4i/exact sample rate #1654

Merged
merged 4 commits into from
Aug 6, 2019
Merged

Feature/m4i/exact sample rate #1654

merged 4 commits into from
Aug 6, 2019

Conversation

peendebak
Copy link
Contributor

The M4i sample_rate parameter returns the sample rate, but rounded to an integer number of Hz. This PR adds a method to return the exact sample rate.

The original parameter is unchanged and naming is similar to the old parameter.

@astafan8 @jenshnielsen

@codecov
Copy link

codecov bot commented Aug 4, 2019

Codecov Report

Merging #1654 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1654   +/-   ##
=======================================
  Coverage   67.01%   67.01%           
=======================================
  Files         143      143           
  Lines       17645    17645           
=======================================
  Hits        11825    11825           
  Misses       5820     5820

Copy link
Collaborator

@jenshnielsen jenshnielsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me. Are there chances that the corner cases where this would round the opposite ways and give an off by one error in the divisor

@peendebak
Copy link
Contributor Author

@jenshnielsen I executed

prev_rate=0
for rate in np.linspace(.005e6, 250e6, 300):
    m4i.sample_rate(rate)
    if prev_rate ==m4i.sample_rate():
        continue
    prev_rate = m4i.sample_rate()
    print(f'sample_rate {m4i.sample_rate()} exact_sample_rate {m4i.exact_sample_rate()}' )

to check. The exact_sample_rate gives the correct values.

@jenshnielsen jenshnielsen merged commit 5f520c2 into microsoft:master Aug 6, 2019
@jenshnielsen
Copy link
Collaborator

@peendebak Cool thanks

@peendebak peendebak deleted the feature/m4i/exact_sample_rate branch August 6, 2019 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants