Butterworth Low-Pass Filter Simulator
Simulation Flow & Theory
This simulator performs DSB-SC (Double Sideband Suppressed Carrier) demodulation for a user-defined message signal and carrier. The steps are as follows:
- Generate the message signal: m(t) = Am cos(2Ï€ fm t)
- Generate the carrier: c(t) = cos(2Ï€ fc t)
- DSB-SC modulation: s(t) = m(t) · c(t)
- Demodulation: multiply the modulated signal by the same carrier to get m(t) · cos²(2Ï€ fc t)
- Apply zero-phase Butterworth low-pass filter to remove the high-frequency term and retain the baseband message
- Remove DC offset to center the signal around zero
- Multiply by 2 to compensate the natural 1/2 scaling from cos²(θ) = (1 + cos(2θ))/2
Butterworth Filter: A first-order low-pass Butterworth filter is applied using the difference equation:
y[n] = α·x[n] + (1-α)·y[n-1],
where α = ωc / (ωc + 1), ωc = 2π fc / Fs,
and Fs is the sampling frequency, fc is the cutoff frequency.
To implement an N-th order Butterworth filter, we cascade the first-order filter N times. The zero-phase filtering is achieved by applying the filter forward and backward to remove phase distortion.