pull/2003/head
Yang Zhou 3 years ago
parent ce322a60f8
commit 1a10c4cde8

@ -15,8 +15,8 @@
#pragma once #pragma once
#include "base/common.h" #include "base/common.h"
#include "frontend/audio/frontend_itf.h"
#include "frontend/audio/feature_common.h" #include "frontend/audio/feature_common.h"
#include "frontend/audio/frontend_itf.h"
#include "kaldi/feat/feature-fbank.h" #include "kaldi/feat/feature-fbank.h"
#include "kaldi/feat/feature-mfcc.h" #include "kaldi/feat/feature-mfcc.h"
#include "kaldi/matrix/kaldi-vector.h" #include "kaldi/matrix/kaldi-vector.h"
@ -25,11 +25,11 @@ namespace ppspeech {
class FbankComputer { class FbankComputer {
public: public:
typedef kaldi::FbankOptions Options; typedef kaldi::FbankOptions Options;
explicit FbankComputer(const Options& opts); explicit FbankComputer(const Options& opts);
kaldi::FrameExtractionOptions& GetFrameOptions() { kaldi::FrameExtractionOptions& GetFrameOptions() {
return opts_.frame_opts; return opts_.frame_opts;
} }
bool Compute(kaldi::Vector<kaldi::BaseFloat>* window, bool Compute(kaldi::Vector<kaldi::BaseFloat>* window,
@ -42,7 +42,7 @@ class FbankComputer {
Options opts_; Options opts_;
kaldi::FbankComputer computer_; kaldi::FbankComputer computer_;
//DISALLOW_COPY_AND_ASSIGN(FbankComputer); DISALLOW_COPY_AND_ASSIGN(FbankComputer);
}; };
typedef StreamingFeatureTpl<FbankComputer> Fbank; typedef StreamingFeatureTpl<FbankComputer> Fbank;

@ -16,15 +16,15 @@
#pragma once #pragma once
#include "base/common.h" #include "base/common.h"
#include "frontend/audio/feature_common.h"
#include "frontend/audio/frontend_itf.h" #include "frontend/audio/frontend_itf.h"
#include "kaldi/feat/feature-window.h" #include "kaldi/feat/feature-window.h"
#include "frontend/audio/feature_common.h"
namespace ppspeech { namespace ppspeech {
struct LinearSpectrogramOptions { struct LinearSpectrogramOptions {
kaldi::FrameExtractionOptions frame_opts; kaldi::FrameExtractionOptions frame_opts;
LinearSpectrogramOptions(): frame_opts() {} LinearSpectrogramOptions() : frame_opts() {}
}; };
class LinearSpectrogramComputer { class LinearSpectrogramComputer {
@ -33,7 +33,7 @@ class LinearSpectrogramComputer {
explicit LinearSpectrogramComputer(const Options& opts); explicit LinearSpectrogramComputer(const Options& opts);
kaldi::FrameExtractionOptions& GetFrameOptions() { kaldi::FrameExtractionOptions& GetFrameOptions() {
return opts_.frame_opts; return opts_.frame_opts;
} }
bool Compute(kaldi::Vector<kaldi::BaseFloat>* window, bool Compute(kaldi::Vector<kaldi::BaseFloat>* window,
@ -42,17 +42,16 @@ class LinearSpectrogramComputer {
int32 Dim() const { return dim_; } int32 Dim() const { return dim_; }
bool NeedRawLogEnergy() { return false; } bool NeedRawLogEnergy() { return false; }
private: private:
kaldi::BaseFloat scale_; kaldi::BaseFloat scale_;
Options opts_; Options opts_;
int32 frame_length_; int32 frame_length_;
int32 dim_; int32 dim_;
DISALLOW_COPY_AND_ASSIGN(LinearSpectrogramComputer);
}; };
typedef StreamingFeatureTpl<LinearSpectrogramComputer> LinearSpectrogram; typedef StreamingFeatureTpl<LinearSpectrogramComputer> LinearSpectrogram;
//DISALLOW_COPY_AND_ASSIGN(LinearSpectrogram);
} // namespace ppspeech } // namespace ppspeech
Loading…
Cancel
Save