/*
   HARK Library
   Copyright (C) 2021 Honda Research Institute Japan Inc.
 */

#if !defined(_HARKLIB_NODE_WHITE_NOISE_ADDER_H_INCLUDED_)
#define _HARKLIB_NODE_WHITE_NOISE_ADDER_H_INCLUDED_ 1

#include "hark-lib/hark-lib.h"
#include "hark-lib/node.h"

#include <random>
#include <string>
#include <vector>
#include <complex>

namespace hark
{
namespace node
{
    class WhiteNoiseAdder: public NodeDef
    {
    public:
        WhiteNoiseAdder();

        void initialize(InputDataBundle &input);
        virtual void reset();
        virtual bool operator () (size_t count, InputDataBundle &input, OutputDataBundle &output);

    private:
        const float coef = 3.141592653589793238462643383279502884L * 2.0f;

        int length;
        float wn_level;
        float wn_factor;
        float wn_coef;

        std::mt19937 gen;
        std::uniform_real_distribution<float> rand_uniform;
    };
}
}

#endif /* #if !defined(_HARKLIB_NODE_WHITE_NOISE_ADDER_H_INCLUDED_) */

/* end of file */
