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

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

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