RfftPlan class

Reusable real-input FFT plan (r2c) with internal native buffers.

Instances manage a native plan and associated scratch/output storage. Call close when the plan is no longer needed to release native memory.

Example:

import 'dart:typed_data';
import 'package:open_dspc/open_dspc.dart';

final plan = RfftPlan(1024);
try {
  final x = SignalGenerator.sine(n: 1024, freqHz: 440, sampleRate: 16000);
  final z = plan.execute(x); // Complex32List backed by plan.re/plan.im
  final db = plan.executeSpec(x, mode: SpecMode.db, dbFloor: -120);

  final outRe = Float32List(plan.bins);
  final outIm = Float32List(plan.bins);
  plan.executeInto(x, outRe, outIm);
} finally {
  plan.close();
}
Inheritance

Constructors

RfftPlan(int n)
Creates a reusable r2c FFT plan for transform length n.
factory

Properties

bins int
Number of non-redundant bins (n ~/ 2 + 1).
final
hashCode int
The hash code for this object.
no setterinherited
im Float32List
Reusable imaginary-part output buffer for execute.
final
isClosed bool
Whether close() has been called.
no setterinherited
n int
FFT length used by this plan.
final
re Float32List
Reusable real-part output buffer for execute.
final
res → _RfftPlanResource
Throws if closed; returns the native resource otherwise.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spec Float32List
Reusable scalar spectrum buffer for executeSpec.
final

Methods

close() → void
Deterministic cleanup.
inherited
execute(Float32List input) Complex32List
Computes the non-redundant complex spectrum of a real-valued input frame.
executeInto(Float32List input, Float32List outRe, Float32List outIm) → void
Zero-allocation API: caller provides output buffers for the complex spectrum.
executeSpec(Float32List input, {SpecMode mode = SpecMode.power, double dbFloor = -120.0}) Float32List
Computes a magnitude, power, or dB spectrum into the reusable spec buffer.
executeSpecInto(Float32List input, Float32List outBins, {SpecMode mode = SpecMode.power, double dbFloor = -120.0}) → void
Zero-allocation API: caller provides output storage for the scalar spectrum.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited