Fourier Transform — Control Systems/Symbolic
Control_Systems/Symbolic/Fourier_Transform · 1 input / 1 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text
Description#
The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.
Fourier Transform
Control Systems / Symbolic
Takes the Fourier transform of an expression symbolically and evaluates
the result on the input at every sample – MATLAB's fourier, or
ifourier when Direction is Inverse:
F(w) = ∫ f(t)·e−i·w·t dt · f(t) = (1/2π)·∫ F(w)·ei·w·t dw, both over the whole line.
The transform is done once, when the configuration loads, from a table of the pairs MATLAB answers. What runs per sample is the RESULT. ⚠ This block does not transform a SIGNAL – there is no integral and no FFT anywhere in the emitted body. It answers F at this w, which is what lets a spectrum derived symbolically be evaluated on a wire.
⚠ The answer is complex, so the output is a complex signal. The factory setting is heaviside(t)·e−2t, whose transform is 1/(2 + i·w): real part 2/(w²+4), imaginary part −w/(w²+4).
Ports
- x – the variables, a vector of n entries (a column [n,1] or a row [1,n]) where n is the number of names in Variables: entry k is the k-th name. A Mux in front builds it from scalar signals. ⚠ The SOURCE variable's entry is not read by the result – the transform eliminated it. It is still declared, and still an entry, because the expression that goes IN is written over it.
- y (
cplx) – the transform, a complex signal the same shape as the expression: [1,1] for a scalar, [r,c] for a matrix literal, which is transformed entry by entry as MATLAB's own does. Like every complex signal it travels as [r,2c] numbers, each entry's real part beside its imaginary part; a Complex to Real-Imag block takes the parts apart.
Parameters
- Expression – the expression to transform, in MATLAB syntax over
the names in Variables: numbers,
pi,+ - * / ^, parentheses and the functionssin cos tan sec csc cot asin acos atan acot sinh cosh tanh asinh acosh atanh exp log log2 log10 sqrt abs sign heaviside. A matrix is written[f1; f2]. The imaginary unit cannot be typed: the input is real, and only the answer is complex. - Variables – the names of the input's entries, in order:
t w. ⚠ BOTH the source and the target must be here, because the answer is an expression in the target and it is read back against this list. Each is a MATLAB identifier, none may repeat, and none may be a function name orpi,e,i,j,Inf,NaNoreps. At most 12. - Source Variable – the variable the expression is written over (t for a forward transform, w for an inverse one). It must be one of the declared Variables.
- Target Variable – the variable the answer is written over. It must be one of the declared Variables too, and different from the source. MATLAB picks these by a rule when they are omitted; here they are named, because a block cannot depend on what its neighbours happen to be called.
- Direction – Forward for
fourier, Inverse forifourier. - Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.
Code export
All ten targets: Python, MATLAB, Java, Rust,
C, C++, VHDL, Verilog, SystemVerilog and
PLC Structured Text. The transform is done once, at configuration load, and
its answer is split into a real and an imaginary part there too; what each target
carries is those two parts, printed as two inline expressions per entry with their
constants folded to 17 significant digits, so a generated core transforms nothing
and needs no complex arithmetic. Where a target lacks a function it gets the
identity – Java has no inverse hyperbolic functions and PLC Structured Text
no hyperbolic functions at all, so those are written through log,
exp and sqrt. The three HDL targets are
simulation-only real arithmetic, quantized to Q16.16 only at
the ports.
Simulink bridge
None (Support::None). fourier is a Symbolic
Math Toolbox function, and that toolbox ships no Simulink library at all, so there
is no library path a diagram could name; the bridge reports this block rather than
dropping it, and it therefore has no parity testbench. Code export
verification covers it across all ten languages. No configuration crosses,
including "Sampling Time (s)".
Notes
- ⚠ An answer holding an impulse is REFUSED.
fourier(1)is 2π·dirac(w), and an impulse has no value at a sample, sodiracis refused by name wherever it appears. A constant, a polynomial, andcosorsinwithout a decaying envelope all answer one; multiply by a decaying envelope (exp(-t^2),heaviside(t)*exp(-t)) and they transform. - ⚠ A term the table cannot do is REFUSED, not carried. MATLAB leaves
fourier(g(t), t, w)standing in its answer and so does the engine behind this block; the family's reader then refuses it by name, because an unevaluatedfourieris not something ten targets can print. - The parts are taken with every variable real, which is what a signal is. An answer whose parts cannot be separated that way – a complex value to a power that is not a whole number – is refused with the reason.
- An answer may be singular at a point:
fourier(sign(t))is −2i/w, infinite at w = 0, as MATLAB's is. - Algebraic, with no state: the output depends only on the current input.
- Size limits are on the generated code: 144 entries (each complex entry counts twice), 4000 operations per entry.
- No state space: the map is nonlinear in general, so model reduction correctly declines the block.
Code facts#
| Fact | Value |
|---|---|
| registered type | Control_Systems/Symbolic/Fourier_Transform |
| family | Control_Systems/Symbolic |
| solver environment class | ICoreBlock_0_Control_Systems_1_Symbolic_2_Fourier_Transform |
| source | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Symbolic/Fourier_Transform/ICoreBlock_0_Control_Systems_1_Symbolic_2_Fourier_Transform.cpp |
| header | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Symbolic/Fourier_Transform/ICoreBlock_0_Control_Systems_1_Symbolic_2_Fourier_Transform.h |
| default size on canvas | 132 × 70 px |
| ports at insert | 1 in, 1 out |
| code generators implemented | Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text |
Ports#
| # | Direction | Signal type | Description label |
|---|---|---|---|
| 1 | in | ICoreDouble | x |
| 2 | out | ICoreComplex | y |
Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.
Configuration variables#
| Config variable | Default | Simulink parameter |
|---|---|---|
Expression | heaviside(t)*exp(-2*t) | — |
Variables | t w | — |
Source Variable | t | — |
Target Variable | w | — |
Direction | forwardOption() | — |
Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.
Simulink bridge#
| support | Support::None |
| Simulink path | — |
| port-count rule | PortsParam::None |
SampleTime parameter | yes |
Caveat (shown to the user): fourier is a Symbolic Math Toolbox function, and that toolbox ships no Simulink library at all, so there is no library path a diagram could name; the block is reported rather than dropped when a model crosses
Catalog contract: src/ICoreBlocks/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h
Description vs code#
The checker has a blind spot here — it could not resolve something (a grouped port bullet, a computed config name), which is reported and never counted as a pass. A reader has to settle it:
B0every stimulus in the sample errored — cross-checks skipped
The verdict above is
tools/docs/check_block_descriptions.py(P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.
File banner (developer view)#
The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).
Fourier Transform -- fourier / ifourier, taken from a table at config load F(w) = F{f(t)} Forward f(t) = F^-1{F(w)} Inverse
The transform runs ONCE, when the configuration loads; what each of the ten targets carries is the RESULT, as two inline expressions per entry. There is no integral and no FFT anywhere in the emitted body -- the block answers "F at this w", not "transform this signal", and the description says so in as many words because the name invites the other reading.
The reading, the sizing contract, compute_h and all ten generators are ICoreSymbolicBlockBase's; the transform table is the console's own symbolic engine's (FEATURES_TO_ADD.md BF23.3), reached through ICoreSymbolicProgram. This file is what is genuinely this block's.
⚠ THE ANSWER IS COMPLEX, AND THE WIRE CARRIES IT AS TWO REAL NUMBERS PER ENTRY. A Fourier transform's answers are complex in general -- fourier(heaviside(t)*exp(-2*t)) is 1/(2 + w*1i) -- while the family's reader, and every target's arithmetic, is real. So the answer is split into its real and imaginary parts symbolically, once, with every variable taken as real (ICoreSymbolic::complexParts): 2/(w^2 + 4) and -w/(w^2 + 4). The output port is ICoreComplex (BF23.1), whose matrix is exactly that interleaved [r, 2c] layout, so the base's generators need no complex arithmetic in any target.
⚠ A DISTRIBUTION IS REFUSED BY NAME, not carried. fourier(1) is 2*pi*dirac(w), and an impulse has no value at a sample, so the family's reader refuses
diracwherever it appears (D19, BF23.2). The textbook pairs that answer one -- a constant, a polynomial, cos and sin without a decaying envelope -- are refused for that reason, and the configuration says so.⚠ AN UNTRANSFORMABLE TERM IS A REFUSAL HERE, NOT A PASSTHROUGH, exactly as on Laplace Transform: MATLAB leaves
fourier(g(t), t, w)standing in its answer and so does the engine; the reader then refuses it by name.
Sample results#
No stimulus produced a sampled output in this rig — Invalid input size at Fourier Transform block: ICore Blocks/Home/Fourier Transform. That is a fact about the single-block rig, not a verdict on the block: an offline batch fit, a block whose output only appears at onSolverFinish, or one that needs a driven environment cannot be exercised alone.
Category unsampled · sample time 0.1 · 60 steps · commit b9a9677f9 · produced by docsSample --out <folder> --blocks Fourier_Transform --steps 60
Sample data: docs/generated/samples/Control_Systems__Symbolic__Fourier_Transform.json