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

remove squeeze from dsp #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

remove squeeze from dsp #35

wants to merge 1 commit into from

Conversation

hoyer-a
Copy link
Member

@hoyer-a hoyer-a commented Oct 18, 2024

Remove squeeze from dsp.find_impulse_response_maximum() to match updated behavior in pyfar.

Copy link
Member

@ahms5 ahms5 left a comment

Choose a reason for hiding this comment

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

Thank you for taking care! Maybe we should update the docstring about what is happening.

@hoyer-a
Copy link
Member Author

hoyer-a commented Oct 18, 2024

Like a more detailed explanation what the function does?

The docs in general could use a makeover. In some cases, and also here, the docstring calls for ndarrays as input parameter, but the code clearly uses pyfar Signals.

@ahms5
Copy link
Member

ahms5 commented Oct 18, 2024

oh yes, now I see.
maybe sth like this:

    """Find the maximum of an impulse response as argmax(h(t)).
    Performs an initial SNR check according to a defined threshold level in dB.

    Parameters
    ----------
    impulse_response : pyfar.Signal
        The impulse response
    threshold : double, optional
        Threshold SNR value in dB. A warning is raised if the threshold is not reached. By default 20dB.

    Returns
    -------
    max_sample : np.ndarray of int
        Sample at which the impulse response starts for each channel. The shape will be the ``cshape`` of  ``impulse_response``

    Note
    ----
    The function tries to estimate the SNR in the IR based on the signal energy
in the last 10 percent of the IR.

another point is, is pyfar.dsp.find_impulse_response_start is this function doing the same?

@hoyer-a
Copy link
Member Author

hoyer-a commented Oct 18, 2024

Looks like the calculation is exactly the same, we could just use the pyfar function.
That already happens in pyrato's find_impulse_response_start().

There might be even more cases, i can take a look at it.

@hoyer-a hoyer-a closed this Oct 18, 2024
@hoyer-a hoyer-a reopened this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Implementation in progress
Development

Successfully merging this pull request may close these issues.

2 participants