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

frontend.feature.LiveCMN does not properly handle DataStartSignals #87

Open
timobaumann opened this issue Dec 7, 2018 · 0 comments
Open

Comments

@timobaumann
Copy link
Contributor

timobaumann commented Dec 7, 2018

In contrast to most other processors, LiveCMN does not forget its cache of internal values when a DataStartSignal comes around. Thus, it will churn out stale data even though a new DataStartSignal would indicate that everything before it is probably irrelevant by now. In combination with endpointing (as in #82), this yields stale null objects that immediately end recognition in the decoder.

The following fixes this:

    public Data getData() throws DataProcessingException {

        Data input, output;

        // Collect initial data for estimation
        if (sum == null) {
            while (initialList.size() < initialCmnWindow) {
                input = getPredecessor().getData();
                if (input instanceof DataStartSignal)
                    initialList.clear();
                initialList.add(input);
                if (input instanceof SpeechEndSignal
                        || input instanceof DataEndSignal)
                    break;
            }
            initMeansSums();
            output = initialList.remove(0);
        } else if (!initialList.isEmpty()) {
            // Return the previously collected data
            output = initialList.remove(0);
        } else {
            // Process normal frame
            output = getPredecessor().getData();
            if (output instanceof DataStartSignal) {
                initialList.clear();
                sum = null;
                initialList.add(output);
                output = getData();
            }
        }

        normalize(output);
        return output;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant