Skip to content

Conversation

@awsaf49
Copy link
Contributor

@awsaf49 awsaf49 commented Mar 13, 2023

This PR will add two parameters ref and amin in tfio.audio.dbscale(), similar to librosa power_to_db function.

  • amin will avoid $-inf$ for zero inputs
  • ref will provide more flexibility as many user use np.max as ref.

`amin` will avoid -inf for zero inputs and `ref` will provide more flexibility
@awsaf49 awsaf49 changed the title Add ref and amin argument Add ref and amin argument in dbscale Mar 13, 2023
@awsaf49
Copy link
Contributor Author

awsaf49 commented Mar 13, 2023

cc: @terrytangyuan

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

Could you add some tests?

@awsaf49
Copy link
Contributor Author

awsaf49 commented Mar 13, 2023

Sure, I am working on it.

@awsaf49
Copy link
Contributor Author

awsaf49 commented Mar 13, 2023

@terrytangyuan I have added the tests, please approve the workflow.

@awsaf49
Copy link
Contributor Author

awsaf49 commented Mar 13, 2023

@terrytangyuan there was linting issue with black, I have fixed it. But there is also error with Blazw Windows. But can't seem to figure out the reason.

@yongtang
Copy link
Member

@awsaf49 @terrytangyuan the windows failure is unrelated - you can ignore it for now.

@awsaf49
Copy link
Contributor Author

awsaf49 commented Mar 14, 2023

@yongtang In that case, I think we're good to go.......

@yongtang yongtang merged commit c02d038 into tensorflow:master Mar 14, 2023
@awsaf49 awsaf49 deleted the dbscale branch March 15, 2023 09:02
zheolong pushed a commit to zheolong/io-1 that referenced this pull request Jul 24, 2025
* Add `ref` and `amin` argument

`amin` will avoid -inf for zero inputs and `ref` will provide more flexibility

* Added test for `ref` & `amin` in `dbscale`

* Fix for `black` lint

---------

Co-authored-by: Yong Tang <yong.tang.github@outlook.com>
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.

3 participants