pub mod tf_s;
pub mod tf_z;
pub use self::tf_s::*;
pub use self::tf_z::*;
use num::{Float, Complex};
pub trait TransferFunctionS<F: Float>
where
Self::Z: TransferFunctionZ<F>
{
type Z;
fn tf(&self, s: Complex<F>) -> Complex<F>;
fn tf_fourier(&self, omega: F) -> Complex<F>
{
self.tf(Complex::new(F::zero(), omega))
}
fn to_z(&self, rate: F) -> Self::Z;
}
pub trait TransferFunctionZ<F: Float>
where
Self::A: TransferFunctionS<F>
{
type A;
fn tf(&self, z: Complex<F>) -> Complex<F>;
fn tf_fourier(&self, omega: F) -> Complex<F>
{
self.tf(Complex::cis(omega))
}
fn to_s(&self, rate: F) -> Self::A;
}