Calculator inputs
Formula used
Continuous transform: F(ω) = ∫ f(t)e-iωt dt
Discrete transform: X[k] = Σ x[n]e-i2πkn/N
Frequency bin: f[k] = k · fs / N
Magnitude: |X[k]| = √(Re² + Im²) / N
Phase: φ[k] = atan2(Im, Re)
This calculator samples one or two generated signals, optionally adds offset and noise, applies the chosen window, pads the sequence, and computes a direct discrete Fourier transform for visualization.
How to use this calculator
- Choose the primary waveform and set amplitude, frequency, and phase.
- Enable the second component to study mixed tones and harmonic interaction.
- Set duration and sample rate to control captured time and resolution.
- Select a window and padding factor for cleaner or finer spectra.
- Submit the form to view the waveform, windowed signal, spectrum, and phase.
- Use the CSV and PDF buttons to export the computed summary and tables.
Example data table
| Scenario | Primary signal | Second signal | Sample rate | Window | Observed dominant peak |
|---|---|---|---|---|---|
| Pure tone | Sine, 1.0 amp, 5 Hz | Off | 128 Hz | Hann | ≈ 5 Hz |
| Two-tone mix | Sine, 1.0 amp, 5 Hz | Sine, 0.6 amp, 15 Hz | 128 Hz | Hann | ≈ 5 Hz and 15 Hz |
| Square wave | Square, 1.0 amp, 8 Hz | Off | 256 Hz | Hamming | Odd harmonics visible |
| Aliasing check | Cosine, 1.0 amp, 90 Hz | Off | 128 Hz | Rectangular | Aliased below Nyquist |
FAQs
1. What does this calculator actually show?
It shows the generated time-domain waveform, the windowed signal used for analysis, the frequency magnitude spectrum, and the corresponding phase spectrum after the transform.
2. Why does the dominant frequency sometimes look slightly shifted?
A finite record length limits bin spacing. When a signal frequency falls between bins, leakage spreads energy across nearby bins, so the highest displayed peak may shift slightly.
3. What is the purpose of the window function?
Windowing reduces discontinuities at the record edges. That usually lowers spectral leakage and makes nearby peaks easier to interpret, though some amplitude spreading still remains.
4. Does zero padding improve true frequency resolution?
Zero padding adds more plotted bins and smooths the displayed spectrum, but it does not create new information. Actual resolving power still depends on record length.
5. What is the Nyquist limit in this tool?
Nyquist equals half the sample rate. Frequencies above that limit fold back into lower values, producing aliasing and misleading peaks in the displayed spectrum.
6. Why include a second signal component?
A second component lets you study mixtures, harmonics, beating, and interference. It is useful for seeing how multiple tones appear together in one transform.
7. How should I choose sample rate and duration?
Use a sample rate well above the highest expected frequency and a duration long enough to improve bin spacing. Higher duration usually produces finer frequency steps.
8. Can I export the results for reports or classwork?
Yes. The CSV option exports summary metrics, sample rows, and spectrum rows. The PDF option generates a compact report with the main outputs and peak table.