The frequency sine function describes how an alternating voltage or current oscillates over time, defined mathematically as v(t) = Vpeak sin(2πft), where f is the number of complete cycles per second (Hertz). When you wire up an AC circuit, tune a radio, or program a microcontroller's PWM module, this single variable—frequency—dictates everything from how much current a capacitor will pass to whether your motor whines or runs silently. Grab your oscilloscope and let's break down exactly how this function behaves on the bench.
What the Frequency Sine Function Actually Changes in a Circuit
In a purely resistive DC circuit, frequency doesn't exist. But the moment you introduce alternating current (AC) or time-varying signals, frequency changes the rate of change (dv/dt) of the voltage. This rate of change is what creates reactance in capacitors and inductors.
A capacitor resists changes in voltage. If the frequency sine function oscillates slowly (low f), the capacitor has plenty of time to charge up and block current. If it oscillates rapidly (high f), the capacitor never fully charges, effectively acting as a short circuit to the AC signal. Inductors do the exact opposite: they resist changes in current, meaning high frequencies are choked off while low frequencies pass through.
Worked Numeric Example: Mains vs. Switching Frequencies
Let's look at a real-world scenario to see how the frequency sine function alters component behavior. Suppose you have a standard 10µF electrolytic capacitor and you want to know its impedance (AC resistance, XC) in two different circuits. The formula is XC = 1 / (2πfC).
- Scenario A: 60Hz Mains Ripple.
XC = 1 / (2 × π × 60 × 0.000010) = 265.2 Ω
At mains frequency, this capacitor presents a massive 265 ohms of impedance. It will barely pass any AC current, making it useless for high-speed filtering but fine for bulk energy storage. - Scenario B: 100kHz Switch-Mode Power Supply (SMPS).
XC = 1 / (2 × π × 100,000 × 0.000010) = 0.159 Ω
At a switching frequency of 100kHz, that exact same 10µF capacitor drops to a fraction of an ohm. It will easily shunt high-frequency switching noise to ground.
At 60Hz, a 1µF capacitor passes roughly 2.6mA per volt; at 100kHz, it passes 4.3A per volt. This massive shift is why modern power supplies use high-frequency switching—it allows us to use physically tiny capacitors and transformers instead of the massive, heavy iron cores required for 50/60Hz mains conversion.
Where You Meet This in Practice
You will encounter the frequency sine function across four distinct domains in electrical and electronics work:
- Mains Power (50Hz / 60Hz): The grid operates at these low frequencies due to historical generator designs and transformer core limitations. In the US, nominal voltage is 120V RMS at 60Hz; in the EU/UK/AU, it's 230V RMS at 50Hz. (NIST Time and Frequency Division maintains the atomic standards that keep the US grid locked precisely to 60.000Hz).
- Audio Signals (20Hz - 20kHz): Analog audio is a complex superposition of multiple sine functions. When designing pre-amps or active filters, you must ensure your op-amps have a sufficient gain-bandwidth product to handle the full 20kHz sine wave without phase distortion.
- Switch-Mode Power Supplies (50kHz - 2MHz): ICs like the Texas Instruments LM2596 (150kHz) or modern GaN FET drivers (1MHz+) rely on high-frequency square waves. While technically square waves, they are constructed from a fundamental sine function plus infinite odd harmonics (Fourier series).
- Microcontroller PWM (1kHz - 40MHz): When you use an ESP32 LEDC peripheral to dim an LED or drive a motor, you are synthesizing a variable-duty-cycle waveform. The base frequency of this PWM signal determines whether your motor whines audibly (e.g., 1kHz) or runs silently (e.g., 20kHz+).
Common Confusions: Frequency vs. Angular Velocity vs. Period
People frequently mix up the variables inside the sine function equation. If you are reading a datasheet or writing firmware, confusing these will result in signals that are off by a factor of 6.28 (2π). Here is the definitive breakdown:
| Parameter | Symbol | Unit | What it means on the bench |
|---|---|---|---|
| Frequency | f | Hertz (Hz) | Cycles per second. This is what your function generator dial displays and what your multimeter measures. |
| Angular Velocity | ω (omega) | Radians/sec | The mathematical rate of rotation in the sine function (ω = 2πf). Used heavily in transfer functions and Bode plots, rarely on physical dials. |
| Period | T | Seconds (s) | The time it takes for one complete cycle (T = 1/f). This is what you measure with your oscilloscope's cursors from peak to peak. |
Decision Tree: Picking Your Target Frequency and Component
Let's apply this to a concrete design problem. You need to use an ESP32 to generate a smooth, analog 50Hz sine function to drive a legacy analog panel meter. The ESP32 doesn't have a true DAC on all pins, so you must use PWM and an RC low-pass filter. How do you choose the frequencies and components?
Step 1: Choose the PWM Carrier Frequency
- If driving a DC motor → Choose 20kHz (above human hearing to eliminate whine).
- If driving an LED → Choose 5kHz (prevents visible flicker on camera).
- If filtering to analog audio/sine → Choose 5kHz. (Rule of thumb: PWM frequency should be at least 10x to 50x your target signal frequency. 5kHz is 100x our 50Hz target, making filtering easy).
Step 2: Calculate the RC Filter Cutoff Frequency (fc)
- Your target signal is 50Hz. Your PWM carrier is 5000Hz.
- Set the filter cutoff one decade below the PWM carrier to adequately kill the 5kHz ripple: Target fc = 500Hz.
Step 3: Calculate R and C Values
- Formula: fc = 1 / (2πRC)
- Pick a standard resistor value that won't draw too much current from the GPIO but is low enough to drive the meter. Let's pick R = 1,000 Ω (1kΩ).
- Solve for C: C = 1 / (2π × 1000 × 500) = 0.000000318 F, or 318nF.
Step 4: The Concrete Component Pick
318nF is not a standard E12/E24 value. You need the closest standard capacitor that won't introduce massive dielectric absorption (which distorts sine waves). Avoid Y5V ceramics; use X7R.
FAQ: Troubleshooting Sine Wave Distortions
Why does my sine wave look like a triangle wave on the scope?
You are experiencing slew-rate limiting or bandwidth choking. If you are pushing a 1MHz sine function through a cheap audio op-amp (like an LM358, which has a slew rate of ~0.4V/µs), the op-amp physically cannot change its output voltage fast enough to track the steep slopes of the high-frequency sine wave. Fix: Upgrade to a high-speed op-amp like the TI TL072 or ADA4891 for frequencies above 50kHz.
Why is my 60Hz mains sine wave flattened at the top (clipping)?
This is rarely a generator issue; it's almost always a non-linear load. Devices with cheap bridge rectifiers and undersized smoothing capacitors (like older PC power supplies or cheap LED drivers) only draw current at the very peak of the voltage sine wave. This massive, brief current spike causes a voltage drop across the wiring impedance, flattening the peaks. Fix: If it's happening on your bench, check your isolation transformer's VA rating; you are likely overloading it.
My ESP32 PWM output has high-frequency 'ringing' on the edges. Is this the sine function math failing?
No, the math is fine; the physics of your wiring is causing parasitic inductance. Long jumper wires on a breadboard act as inductors. When the PWM pin switches states in nanoseconds, the parasitic inductance reacts with the probe capacitance, creating an LC resonant tank that rings. Fix: Keep ground leads under 2 inches, use a 22Ω to 47Ω series gate/snubbing resistor right at the GPIO pin, or measure with a proper coaxial BNC probe instead of a long ground-clip scope probe.
When designing or debugging AC systems, never guess the frequency. Measure the period with your scope, calculate the exact Hertz, and select your reactive components based strictly on the X = 1/(2πfC) reality. If you need a default starting point for microcontroller analog emulation, lock your PWM to 5kHz and use an X7R ceramic filter—it is the most forgiving baseline for bench prototyping.






