Skip to content

The scale of high_freq_cutoff is wonky in spectraldiff #140

@pavelkomarov

Description

@pavelkomarov

The cutoff is a number between 0 and 0.5. I wrote in the docstring this is a fraction of the Nyquist frequency, because that's the closest interpretation, but the code is doing this:

discrete_cutoff = int(high_freq_cutoff*N)
omega[discrete_cutoff:N-discrete_cutoff] = 0

That means if the discrete cutoff is 1/2, we zero out nothing. But Nyquist is at $N/2$, not $N$. More sensible would be to rescale this parameter so it actually is a fraction of Nyquist and modify the code to be:

discrete_cutoff = int(high_freq_cutoff*N/2) # Nyquist is at N/2 location, and we're cutting off as a fraction of that
omega[discrete_cutoff:N-discrete_cutoff] = 0

I'll cook it up.

Metadata

Metadata

Assignees

Labels

simplificationunifying, shortening, and cleaning tasks that make the modules and user interface more cohesive

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions