pub trait Sample:
Sealed
+ Float
+ FloatConst
+ NumAssign
+ Copy
+ Send
+ Sync
+ 'static
+ Debug
+ Default {
type R2cPlan: R2cPlan<Self>;
type C2rPlan: C2rPlan<Self>;
type C2cPlan: C2cPlan<Self>;
type R2cPlan2d: R2cPlan2d<Self>;
type C2rPlan2d: C2rPlan2d<Self>;
// Required methods
fn plan_r2c(n_fft: usize) -> SpectrogramResult<Self::R2cPlan>;
fn plan_c2r(n_fft: usize) -> SpectrogramResult<Self::C2rPlan>;
fn plan_c2c(n_fft: usize) -> SpectrogramResult<Self::C2cPlan>;
fn plan_r2c_2d(
nrows: usize,
ncols: usize,
) -> SpectrogramResult<Self::R2cPlan2d>;
fn plan_c2r_2d(
nrows: usize,
ncols: usize,
) -> SpectrogramResult<Self::C2rPlan2d>;
fn from_f64(x: f64) -> Self;
fn from_usize(n: usize) -> Self;
}Expand description
Sealed trait describing a float scalar the FFT backend can operate on.
Implemented for f32 and f64. Each implementor exposes the backend’s
concrete plan types and constructors for those plans.
Required Associated Types§
Required Methods§
Sourcefn plan_r2c(n_fft: usize) -> SpectrogramResult<Self::R2cPlan>
fn plan_r2c(n_fft: usize) -> SpectrogramResult<Self::R2cPlan>
Build a real-to-complex 1D FFT plan of length n_fft.
§Errors
Returns an error if the backend fails to construct the plan.
Sourcefn plan_c2r(n_fft: usize) -> SpectrogramResult<Self::C2rPlan>
fn plan_c2r(n_fft: usize) -> SpectrogramResult<Self::C2rPlan>
Build a complex-to-real 1D inverse FFT plan of length n_fft.
§Errors
Returns an error if the backend fails to construct the plan.
Sourcefn plan_c2c(n_fft: usize) -> SpectrogramResult<Self::C2cPlan>
fn plan_c2c(n_fft: usize) -> SpectrogramResult<Self::C2cPlan>
Build a complex-to-complex 1D FFT plan of length n_fft.
§Errors
Returns an error if the backend fails to construct the plan.
Sourcefn plan_r2c_2d(nrows: usize, ncols: usize) -> SpectrogramResult<Self::R2cPlan2d>
fn plan_r2c_2d(nrows: usize, ncols: usize) -> SpectrogramResult<Self::R2cPlan2d>
Build a real-to-complex 2D FFT plan of dimensions nrows x ncols.
§Errors
Returns an error if the backend fails to construct the plan.
Sourcefn plan_c2r_2d(nrows: usize, ncols: usize) -> SpectrogramResult<Self::C2rPlan2d>
fn plan_c2r_2d(nrows: usize, ncols: usize) -> SpectrogramResult<Self::C2rPlan2d>
Build a complex-to-real 2D inverse FFT plan of dimensions nrows x ncols.
§Errors
Returns an error if the backend fails to construct the plan.
Sourcefn from_f64(x: f64) -> Self
fn from_f64(x: f64) -> Self
Convert an f64 constant/literal to this scalar (for PI-derived consts, casts).
Sourcefn from_usize(n: usize) -> Self
fn from_usize(n: usize) -> Self
Convert a usize (e.g. an index or length) to this scalar.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".