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

Add signed log10 stretching #47

Open
erikmannerfelt opened this issue Feb 24, 2025 · 0 comments
Open

Add signed log10 stretching #47

erikmannerfelt opened this issue Feb 24, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@erikmannerfelt
Copy link
Owner

I don't know what to call this filter, but I've been thinking of a log10 filter that preserves signs for quite some time.

sign = np.sign(data)
minval = 4
data = np.clip(np.log10(np.abs(data) + 10**(-minval)) + minval, 0, None) * sign

In this case, 1e-4 would be the smallest perceptible value and it would scale in log10 in both directions afterward.

This preserves the positive/negative directionality (as opposed to abslog) but still converts it to a dB-like scale. Very good for visualization!

@erikmannerfelt erikmannerfelt added the enhancement New feature or request label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant