在tarsos DSP中实现具有音调检测的滤波器

时间:2016-08-28 11:30:39

标签: signal-processing tarsosdsp

我想在使用tarsosDSP进行音高检测之前过滤传入的音频。我尝试在音高检测之前添加高通和低通滤波器。但是,音调检测输出甚至超出300hz或6000Hz范围之外的所有频率。代码中有问题吗?

   PitchDetectionHandler handler = new PitchDetectionHandler() {
        @Override
        public void handlePitch(PitchDetectionResult pitchDetectionResult,
                                AudioEvent audioEvent) {

            System.out.println(audioEvent.getTimeStamp() + " " +pitchDetectionResult.getPitch());

        }
    };


    AudioDispatcher dispatcher = AudioDispatcherFactory.fromDefaultMicrophone(44100,2048,0);
    dispatcher.addAudioProcessor(new LowPassFS(5000, 44100));
    dispatcher.addAudioProcessor(new HighPass(2000, 44100));
   //dispatcher.run();

    dispatcher.addAudioProcessor(new PitchProcessor(PitchProcessor.PitchEstimationAlgorithm.YIN, 44100, 2048, handler));

    new Thread(dispatcher,"Audio Dispatcher").start();

1 个答案:

答案 0 :(得分:-1)

音高可以低于输入滤波器通带中的所有频率(参见音高估计中的“缺少基波”)。

根据过渡带的宽度,高于截止频率20%的频率可能仅通过低通滤波器部分衰减。