Documentation

Signals.RadioBasics

A crystal radio diode detector with forward voltage drop and threshold sensitivity.

A crystal detector is a simple nonlinear device (typically a point-contact diode or germanium crystal junction) that rectifies AC radio signals into DC for audio reproduction or further detection. The detector exhibits:

  • A minimum voltage threshold before conduction begins
  • A forward voltage drop during conduction (energy loss across the junction)
  • Asymmetric conduction (passes positive peaks, blocks negative peaks)

This structure records both parameters to model realistic detector performance. Ideal crystal detectors have zero forward drop and negligible threshold.

  • forwardDrop : ℝ

    Forward voltage drop of the detector junction in volts. This is the voltage lost across the diode when it conducts; typically 0.2-0.7 V for germanium (0.3 V typical) or silicon (0.6 V typical).

  • threshold : ℝ

    Minimum incident voltage for detector conduction in volts. Below this threshold, the junction does not conduct and no output is produced. Typical values: 0.1-0.5 V for sensitive crystal detectors.

  • hThreshold : self.threshold > 0
  • hDrop : 0 ≤ self.forwardDrop
  • hDropSmall : self.forwardDrop < self.threshold
Instances For

    Ideal crystal detector: zero forward drop, zero threshold.

    This represents a perfect rectifying junction with no parasitic losses. Real crystal detectors degrade performance toward this ideal as temperature and contact pressure are optimized.

    Instances For
      noncomputable def Signals.Radio.crystalDetectorOutput (detector : CrystalDetector) (inputVoltage : ℝ) :
      ℝ

      The detected output voltage of a crystal diode exposed to an AC signal.

      The detector conducts only when the input voltage exceeds the threshold, producing a half-wave rectified envelope. This models the nonlinear I-V curve of a point-contact diode junction:

      • Input < threshold: no conduction, output = 0
      • Input ≥ threshold: conduction, output = input - forwardDrop (voltage lost)

      The output voltage represents the envelope of the original RF signal, which is then low-pass filtered to recover the modulation (audio).

      Instances For

        AM (Amplitude Modulation) signal: a carrier modulated by a baseband message.

        Mathematical form: s(t) = [A_c + m(t)] * cos(2πf_ct + φ) or equivalently: s(t) = A_c[1 + μn(t)] * cos(2πf_c*t + φ)

        where:

        • A_c: carrier amplitude (peak voltage of the unmodulated carrier)
        • m(t): modulating signal (audio, data, etc.)
        • f_c: carrier frequency (center transmission frequency in Hz)
        • φ: initial phase offset
        • μ = modulationIndex: depth of modulation (0 to 1 for linear AM)

        AM creates two symmetric sidebands at f_c ± f_m for each frequency component f_m in the modulation. The total bandwidth is 2*f_m, making AM bandwidth-efficient but noise-sensitive (no frequency modulation to spread signal energy).

        Overmodulation (μ > 1) causes:

        • Envelope distortion (clipping)
        • Spectral spreading beyond theoretical sidebands
        • Reduced demodulation efficiency
        • carrierFreq : ℝ

          Carrier frequency in Hz. This is the center frequency of transmission. Standard AM broadcast band: 530 kHz to 1.7 MHz. Each station is allocated a 10 kHz channel.

        • carrierAmplitude : ℝ

          Carrier amplitude in volts. Peak voltage of the unmodulated carrier wave before modulation.

        • hCarrierAmp : self.carrierAmplitude > 0
        • modulation : ℝ → ℝ

          The modulating baseband signal (e.g., audio). This is the low-frequency message signal (typically 20 Hz to 15 kHz for audio) that modulates the high-frequency carrier.

        • modulationIndex : ℝ

          Modulation index: ratio of modulation peak to carrier amplitude. μ = max|m(t)| / A_c. Constraint 0 ≤ μ ≤ 1 ensures no overmodulation. μ = 0 (unmodulated carrier), μ = 1 (100% modulation, maximum allowed).

        • hModIndex : 0 ≤ self.modulationIndex ∧ self.modulationIndex ≤ 1
        • phase : ℝ

          Initial phase offset in radians. Phase rotation applied to the carrier at t=0. Range: [-π, π].

        Instances For
          noncomputable def Signals.Radio.AMSignal.envelope (signal : AMSignal) (t : ℝ) :
          ℝ

          The instantaneous amplitude (envelope) of an AM signal at time t.

          The envelope A(t) = A_c[1 + μ*m(t)] represents the time-varying peak voltage of the modulated signal. When low-pass filtered (high-frequency carrier removed), the envelope directly yields the original modulation m(t).

          For 100% modulation (μ = 1), the envelope varies from 0 (silence) to 2*A_c (peak).

          Instances For
            noncomputable def Signals.Radio.AMSignal.voltage (signal : AMSignal) (t : ℝ) :
            ℝ

            The instantaneous voltage of an AM signal at time t.

            This is the actual transmitted waveform: s(t) = A(t) * cos(2πf_ct + φ) where A(t) is the envelope. The carrier frequency f_c is much higher than the modulation bandwidth, so the signal appears as a high-frequency oscillation with slowly-varying envelope.

            Demodulation is typically performed by:

            1. Rectification (diode detector or synchronous demodulator)
            2. Low-pass filtering to remove carrier frequency
            3. Optional amplification of the recovered modulation
            Instances For
              noncomputable def Signals.Radio.AMSignal.lowerSideband (signal : AMSignal) (modulationFreq : ℝ) :
              ℝ

              The lower sideband frequency of an AM signal.

              For a modulation component at frequency f_m, the lower sideband appears at f_LSB = f_c - f_m. The lower and upper sidebands are symmetric mirror images around the carrier frequency. Both contain identical information (in AM, the carrier is not removed, so you receive both sidebands).

              Single-Sideband (SSB) modulation suppresses one sideband and the carrier, cutting bandwidth in half, but requiring more complex demodulation.

              Instances For
                noncomputable def Signals.Radio.AMSignal.upperSideband (signal : AMSignal) (modulationFreq : ℝ) :
                ℝ

                The upper sideband frequency of an AM signal.

                For a modulation component at frequency f_m, the upper sideband appears at f_USB = f_c + f_m. Together with the lower sideband, the USB ensures that AM creates a transmitted spectrum spanning from (f_c - f_m) to (f_c + f_m).

                Instances For
                  noncomputable def Signals.Radio.AMSignal.bandwidth (_signal : AMSignal) (basebandbandwidth : ℝ) :
                  ℝ

                  The bandwidth required to transmit an AM signal is twice the baseband bandwidth.

                  For a baseband signal with bandwidth B_m (e.g., 5 kHz for audio), the AM signal requires a transmission bandwidth of B_AM = 2*B_m because both upper and lower sidebands must be transmitted.

                  Implication: AM is bandwidth-efficient (compared to other modulation schemes), but all the bandwidth is centered far from DC, requiring a high-frequency carrier.

                  Instances For

                    FM (Frequency Modulation) signal: a carrier whose frequency is modulated by a message.

                    Mathematical form: s(t) = A_c * cos(2πf_ct + 2π*Δf * ∫₀ᵗ m(τ) dτ + φ)

                    where:

                    • A_c: carrier amplitude (constant; unlike AM where amplitude varies)
                    • f_c: carrier frequency (center transmission frequency)
                    • Δf: frequency deviation (peak frequency shift from f_c)
                    • m(t): modulating signal (baseband message)
                    • ∫ m(τ) dτ: integral of modulation (phase accumulation)

                    FM encodes information in frequency, not amplitude, offering several advantages:

                    1. Constant amplitude: transmitter power is constant (efficient)
                    2. Noise immunity: amplitude variations (noise) have minimal effect
                    3. Trade-off: requires wider bandwidth than AM for improved noise performance

                    The instantaneous frequency varies: f_inst(t) = f_c + Δf*m(t)

                    FM bandwidth is determined by Carson's Rule: B_FM ≈ 2(Δf + f_m) where f_m is the modulation bandwidth.

                    Commercial FM: f_c = 88-108 MHz, Δf = 75 kHz, f_m ≤ 15 kHz, B_FM ≈ 180 kHz/channel

                    • carrierFreq : ℝ

                      Carrier frequency in Hz. For commercial FM radio: 88 to 108 MHz. Each station occupies 200 kHz spacing (but only uses ~180 kHz bandwidth).

                    • carrierAmplitude : ℝ

                      Carrier amplitude in volts. Unlike AM, this remains constant regardless of modulation. This makes FM power efficiency constant and independent of modulation depth.

                    • hCarrierAmp : self.carrierAmplitude > 0
                    • modulation : ℝ → ℝ

                      The modulating baseband signal. Time-domain baseband message (e.g., audio, data).

                    • frequencyDeviation : ℝ

                      Frequency deviation: maximum shift from carrier in Hz. Δf is the peak frequency excursion of the modulated signal. Commercial FM: Δf = 75 kHz (±75 kHz from f_c). For a 1 kHz audio tone at 100% modulation, carrier shifts ±75 kHz.

                    • hFreqDev : self.frequencyDeviation > 0
                    • phase : ℝ

                      Initial phase offset in radians.

                    Instances For
                      noncomputable def Signals.Radio.FMSignal.instantaneousFreq (signal : FMSignal) (t : ℝ) :
                      ℝ

                      The instantaneous frequency of an FM signal at time t.

                      For FM with a sinusoidal modulation m(t), the instantaneous frequency is f_inst(t) = f_c + Δf * m(t).

                      The instantaneous frequency tracks the modulation, reaching maximum f_c + Δf when m(t) = +1 and minimum f_c - Δf when m(t) = -1.

                      This differs from AM (where amplitude varies) by keeping frequency variation while maintaining constant amplitude, maximizing power efficiency while preserving noise immunity.

                      Instances For
                        noncomputable def Signals.Radio.FMSignal.voltage (signal : FMSignal) (t : ℝ) :
                        ℝ

                        The instantaneous voltage of an FM signal assuming the phase accumulation is represented as an integral of frequency deviation over time.

                        The full FM equation includes the integral term: s(t) = A_c * cos(2πf_ct + 2π*Δf * ∫₀ᵗ m(τ) dτ + φ)

                        This simplified definition uses the carrier directly for the time-domain voltage. The integral of modulation is implicit in the frequency modulation mechanism.

                        Note: Real FM demodulation (e.g., discriminator) recovers m(t) by detecting frequency changes, not by amplitude detection as in AM crystal radios.

                        Instances For
                          noncomputable def Signals.Radio.FMSignal.modulationIndex (signal : FMSignal) (modulationFreq : ℝ) :
                          ℝ

                          The modulation index (Carson's index) for an FM signal with sinusoidal modulation.

                          Carson's index β = Δf / f_m characterizes the FM modulation regime:

                          • β << 1 (e.g., β = 0.1): Narrowband FM; bandwidth ≈ 2*f_m (similar to AM)
                          • β ≈ 1-5: Wideband FM; Carson's rule applies: B = 2(Δf + f_m)
                          • β >> 1 (e.g., β = 10): Very wideband FM; bandwidth ≈ 2*Δf

                          Commercial FM radio uses β ≈ 5 (Δf = 75 kHz, f_m = 15 kHz): B = 2(75 + 15) = 180 kHz per 200 kHz channel spacing.

                          Higher β provides better noise immunity at the cost of bandwidth.

                          Instances For
                            noncomputable def Signals.Radio.FMSignal.carsonBandwidth (signal : FMSignal) (modulationFreq : ℝ) :
                            ℝ

                            Carson's bandwidth rule: the approximate bandwidth needed for FM transmission.

                            B_FM ≈ 2 * (Δf + f_m)

                            where:

                            • Δf: frequency deviation (peak frequency shift)
                            • f_m: modulation bandwidth (highest frequency in the message)

                            Carson's rule is an empirical approximation that accounts for:

                            1. The main carrier component
                            2. Significant sidebands generated by FM modulation
                            3. Practical receiver filtering

                            The rule assumes sinusoidal modulation and is reasonably accurate for most audio and data signals.

                            Example (Commercial FM Radio):

                            • Δf = 75 kHz, f_m = 15 kHz → B = 2(75 + 15) = 180 kHz
                            • 200 kHz channel spacing allows ±10 kHz guard bands

                            Example (Narrowband FM, β = 0.5):

                            • Δf = 5 kHz, f_m = 10 kHz → B = 2(5 + 10) = 30 kHz
                            Instances For
                              noncomputable def Signals.Radio.FMSignal.narrowbandApprox (_signal : FMSignal) (modulationFreq : ℝ) :
                              ℝ

                              Narrowband FM approximation: when modulation index β << 1, FM bandwidth ≈ 2*f_m.

                              In the narrowband regime (β << 1), FM and AM require nearly identical bandwidth. The FM signal occupies a narrow band around the carrier, similar to AM.

                              This occurs when:

                              • Small frequency deviation (Δf << f_m), or
                              • High modulation frequency (f_m >> Δf)

                              Narrowband FM is used in applications where spectrum is scarce (e.g., mobile radio systems, emergency services).

                              Tradeoff: Narrowband FM has poor noise immunity compared to wideband FM.

                              Instances For
                                noncomputable def Signals.Radio.FMSignal.widebandApprox (signal : FMSignal) (_modulationFreq : ℝ) :
                                ℝ

                                Wideband FM: when modulation index β >> 1, Carson's rule applies strictly.

                                In the wideband regime (β >> 1), FM requires much more bandwidth than the original modulation bandwidth, but provides significantly better noise immunity.

                                This occurs when frequency deviation dominates: Δf >> f_m

                                Characteristics of wideband FM:

                                • Bandwidth determined primarily by frequency deviation: B ≈ 2*Δf
                                • Signal energy spreads over many sidebands
                                • Noise rejection improves as β increases (noise advantage)
                                • Transmitter efficiency remains constant (constant amplitude)

                                Commercial FM uses wideband FM: β ≈ 5 Satellite communications use even larger β (β > 10) for enhanced noise immunity.

                                Tradeoff: Wideband FM requires wider allocated bandwidth.

                                Instances For

                                  A simple AM/FM receiver with tuning and demodulation.

                                  Key receiver parameters:

                                  • Tuning: selecting the desired carrier frequency (manual dial or automatic search)
                                  • Selectivity: rejecting adjacent-channel interference via filtering
                                  • Sensitivity: minimum detectable signal (often measured in microvolts or dBm)

                                  A practical receiver includes:

                                  1. RF input stage (preamp or direct connection)
                                  2. Tunable LC filter (selects desired frequency)
                                  3. Mixer (converts to intermediate frequency or baseband)
                                  4. Demodulator (AM detector or FM discriminator)
                                  5. Audio amplifier (recovers audio message)
                                  6. Loudspeaker or line output

                                  This simplified model captures the essential filtering and detection aspects.

                                  • tuneFreq : ℝ

                                    Tuned receiver frequency (center frequency) in Hz. This is the frequency the receiver is currently listening to. For AM: typically 530 kHz to 1.7 MHz (broadcast band). For FM: typically 88 to 108 MHz (commercial band).

                                  • bandwidth : ℝ

                                    Receiver bandwidth (filter selectivity) in Hz. Defines the range of frequencies the receiver accepts. Narrower bandwidth → better adjacent-channel rejection, poorer coverage. Broader bandwidth → poorer adjacent-channel rejection, better coverage.

                                    AM receivers: typically 10 kHz bandwidth (matching station spacing). FM receivers: typically 200 kHz bandwidth (matching channel spacing).

                                    Bandwidth is implemented by LC tuning circuit, IF filter, or DSP filter.

                                  • hBandwidth : self.bandwidth > 0
                                  • sensitivity : ℝ

                                    Receiver sensitivity (minimum detectable signal) in volts. The smallest input voltage that produces usable output. Better sensitivity (lower voltage) requires better design.

                                    Typical AM receiver: 1-100 microvolts for 10 dB SNR. Typical FM receiver: 0.5-10 microvolts for 12 dB SNR.

                                    Sensitivity depends on: noise figure, demodulator type, audio bandwidth.

                                  • hSensitivity : self.sensitivity > 0
                                  Instances For
                                    def Signals.Radio.RadioReceiver.isInBand (receiver : RadioReceiver) (signalFreq : ℝ) :

                                    Check whether an incoming signal is within the receiver's tuning band.

                                    A signal at frequency f_signal is considered "in-band" if its distance from the tuned frequency is less than half the receiver bandwidth:

                                    |f_signal - f_tune| ≤ (bandwidth / 2)

                                    This defines a symmetric frequency range [f_tune - BW/2, f_tune + BW/2] around the tuned frequency. Signals outside this range experience high attenuation (typically >40 dB down from peak response).

                                    Instances For

                                      Proof that a signal at the tuned frequency is always in band.

                                      Obvious property: A signal at exactly the tuned frequency (f_signal = f_tune) always satisfies the in-band condition because |0| = 0 ≤ BW/2 for any BW > 0.

                                      noncomputable def Signals.Radio.voltageToPower (voltage : ℝ) :
                                      ℝ

                                      The voltage-to-power conversion in a 50-ohm impedance system.

                                      Power dissipated in a 50-ohm load: P = V² / 50 Watts

                                      The 50-ohm standard is used throughout RF and microwave engineering because:

                                      1. Coaxial cables naturally have 50-ohm impedance
                                      2. It's a good compromise between voltage and current (useful operating range)
                                      3. It minimizes reflections when source, transmission line, and load are matched

                                      Related conversions:

                                      • V = √(P * 50) (power to voltage)
                                      • dBm = 10*log₁₀(P / 0.001) (power in decibels relative to 1 mW)
                                      • A 1 Volt signal = 0.02 W = +13 dBm into 50 ohms
                                      Instances For
                                        noncomputable def Signals.Radio.powerToVoltage (power : ℝ) :
                                        ℝ

                                        The power-to-voltage conversion in a 50-ohm system.

                                        Voltage across a 50-ohm load: V = √(P * 50) Volts

                                        This is the inverse of voltageToPower. Used when specifying received power levels (in dBm or watts) and needing to calculate the voltage at the receiver input for sensitivity calculations.

                                        Example: -100 dBm = 10⁻¹³ W → V = √(10⁻¹³ * 50) ≈ 2.24 μV (100 pW on 50 Ω)

                                        Instances For

                                          A simple LC tuning circuit resonates at frequency f₀ = 1/(2π√(LC)).

                                          The LC tank circuit is the fundamental frequency-selective element in classical radios. It consists of:

                                          • Inductor (L): energy storage in magnetic field (inductance in Henry)
                                          • Capacitor (C): energy storage in electric field (capacitance in Farad)

                                          At resonance:

                                          • Inductive reactance X_L = ωL equals capacitive reactance X_C = 1/(ωC)
                                          • Net reactance cancels: X_L - X_C = 0
                                          • Impedance is purely resistive (minimum magnitude)
                                          • Circuit draws maximum current (resonant current amplification)

                                          Resonant frequency: f₀ = 1/(2π√(LC)) Hz

                                          Example: L = 100 μH, C = 250 pF → f₀ ≈ 1.006 MHz (AM broadcast)

                                          Q-factor relationship: Q = ω₀L/R = 1/(ω₀RC) determines bandwidth.

                                          • inductance : ℝ

                                            Inductance in Henry. Coil of wire (often ferrite-core for AM frequencies). Typical AM tuner: 1-100 μH. Higher inductance shifts resonance to lower frequencies.

                                          • hInductance : self.inductance > 0
                                          • capacitance : ℝ

                                            Capacitance in Farad. Tuning capacitor (variable for radio tuning, or fixed). Typical AM tuner: 50-500 pF. Higher capacitance shifts resonance to lower frequencies.

                                          • hCapacitance : self.capacitance > 0
                                          Instances For
                                            noncomputable def Signals.Radio.LCTuner.resonantFreq (tuner : LCTuner) :
                                            ℝ

                                            The resonant frequency of an LC circuit in Hz.

                                            At resonance, the LC circuit presents minimum impedance (maximum current) and maximum voltage across either L or C (by Q factor amplification).

                                            Formula: f₀ = 1/(2π√(LC))

                                            Properties:

                                            • Inversely proportional to √(LC): increasing L or C decreases f₀
                                            • Independent of resistance R (but R affects Q)
                                            • Always positive for positive L and C

                                            Derivation: At resonance, X_L = X_C ω₀L = 1/(ω₀C) ω₀² = 1/(LC) ω₀ = 1/√(LC) f₀ = ω₀/(2π) = 1/(2π√(LC))

                                            Instances For
                                              noncomputable def Signals.Radio.LCTuner.impedanceAtFreq (tuner : LCTuner) (frequency : ℝ) :
                                              ℝ

                                              An LC circuit is resonant when its impedance is purely resistive (minimum reactance).

                                              At the resonant frequency f₀, the inductive and capacitive reactances cancel: X_L = ωL equals X_C = 1/(ωC)

                                              The total impedance Z has:

                                              • Magnitude: |Z| = √(R² + (X_L - X_C)²)
                                              • At resonance: |Z| = R (minimum value)
                                              • Off-resonance: |Z| > R

                                              Impedance is calculated as the magnitude of the net reactance (assuming series RLC model, but applicable to parallel through duality).

                                              Z = √((X_L - X_C)²) = |X_L - X_C|

                                              At resonance (f = f₀): X_L - X_C = 0 → Z = 0 (for ideal L, C with no R) With resistance: Z_min = R

                                              Instances For
                                                noncomputable def Signals.Radio.LCTuner.qualityFactor (tuner : LCTuner) (resistance : ℝ) :
                                                ℝ

                                                The quality factor (Q) of an LC circuit measures its selectivity and resonance sharpness.

                                                Q = ω₀L / R = 1 / (ω₀RC) (for series or parallel RLC)

                                                Higher Q means:

                                                • Sharper resonance peak (narrower -3dB bandwidth)
                                                • Better frequency selectivity (rejects nearby frequencies more effectively)
                                                • Higher voltage magnification at resonance (can cause circuit ringing)
                                                • Greater energy storage (more cycles to dissipate energy)

                                                Lower Q means:

                                                • Broader resonance (flatter frequency response)
                                                • Better out-of-band rejection weaker (but less sharp peak)
                                                • Faster transient response (less ringing)

                                                Q vs. Bandwidth: BW = f₀ / Q

                                                • Crystal radio (AM tuner): Q ≈ 100, BW ≈ 10 kHz at f₀ = 1 MHz
                                                • RF filter: Q can be 100-1000 for sharp selectivity

                                                The resistance R includes:

                                                • Coil resistance (wire resistance)
                                                • Load resistance (antenna, detector input impedance)
                                                • Circuit losses (capacitor dissipation factor)
                                                Instances For
                                                  noncomputable def Signals.Radio.LCTuner.bandwidth (tuner : LCTuner) (resistance : ℝ) :
                                                  ℝ

                                                  The bandwidth of an LC resonator in Hz, inversely proportional to Q.

                                                  BW = f₀ / Q

                                                  where f₀ is the resonant frequency and Q is the quality factor.

                                                  The -3dB bandwidth (half-power points) is the frequency range where the power dissipation remains at least half the maximum (at resonance).

                                                  For a series RLC circuit: -3dB bandwidth = R / (2πL) For a parallel RLC circuit: -3dB bandwidth = R / (2πL) or ω₀C/Q

                                                  Relationship between Q and BW:

                                                  • High Q (sharp resonance) → Narrow BW (good selectivity)
                                                  • Low Q (broad resonance) → Wide BW (poor selectivity)

                                                  Example: f₀ = 1 MHz, Q = 100 → BW = 10 kHz (suitable for AM radio, 10 kHz channel spacing) Example: f₀ = 1 MHz, Q = 10 → BW = 100 kHz (suitable for wideband signals)

                                                  The inverse relationship is fundamental: narrower filters require higher Q, which requires lower resistance losses in the circuit.

                                                  Instances For
                                                    def Signals.Radio.isNarrowband (signalBandwidth receiverBandwidth : ℝ) :

                                                    Narrowband condition: if the signal bandwidth is much less than receiver bandwidth, we can treat the AM signal as a narrowband complex envelope.

                                                    Narrowband signals can be represented efficiently in complex baseband (I/Q form):

                                                    • Condition: signal_bandwidth < receiver_bandwidth / 10
                                                    • Requirement: complex envelope changes slowly compared to carrier oscillation

                                                    When a signal is narrowband (relative to the center frequency), we can use the complex baseband representation: s(t) ≈ 2 * Re[s_c(t) * exp(j2πf_c*t)]

                                                    where s_c(t) = A(t)*exp(jφ(t)) is the complex envelope.

                                                    Advantages of narrowband representation:

                                                    1. Reduces sampling rate requirement (Nyquist rate is 2bandwidth, not 2f_c)
                                                    2. Simplifies DSP (work with baseband, not RF)
                                                    3. Enables I/Q demodulation (phase-sensitive detection)
                                                    4. More efficient for communications signal processing

                                                    Practical narrowband constraint: signal_BW / f_c < 0.1 (10% fractional bandwidth) This is why narrowband assumption works for AM (5 kHz BW / 1 MHz) but not for extremely wideband signals (100 MHz BW / 1 GHz).

                                                    Instances For

                                                      A narrowband signal can be represented in complex baseband (I/Q) form at the receiver frequency.

                                                      For narrowband signals, the modulation changes slowly compared to the carrier. This allows representation as:

                                                      s(t) = Re[s_c(t) * exp(j2πf_c*t + jφ)]

                                                      where s_c(t) = I(t) + jQ(t) is the complex baseband envelope.

                                                      I(t) = in-phase component (amplitude of cos(·) term) Q(t) = quadrature component (amplitude of sin(·) term)

                                                      Benefits of I/Q representation:

                                                      1. Efficient DSP (complex envelope at low rate instead of RF at high rate)
                                                      2. Carrier recovery and phase tracking become standard operations
                                                      3. Demodulation separates into magnitude |s_c(t)| and phase ∠s_c(t)
                                                      4. Enables advanced techniques: AFC, AGC, equalization, synchronization

                                                      This is the foundation of modern digital radio receivers and signal processing. See Signals.IQ for complex baseband Sample definition.

                                                      • iqSample : IQ.Sample

                                                        The complex baseband representation as I/Q samples. Encodes amplitude and phase of the narrowband signal. At the receiver's tuned frequency, this represents the demodulated signal.

                                                      • bandwidth : ℝ

                                                        The signal bandwidth in Hz. Maximum frequency range occupied by the narrowband signal. For a narrowband signal: bandwidth << center_frequency.

                                                      • hBandwidth : self.bandwidth > 0
                                                      Instances For
                                                        theorem Signals.Radio.AMDemodulation (signal : AMSignal) (t : ℝ) :
                                                        signal.envelope t = signal.carrierAmplitude * (1 + signal.modulationIndex * signal.modulation t)

                                                        An AM signal demodulated by an ideal envelope detector yields the modulation.

                                                        Theorem: When an AM signal A(t)cos(2πf_c*t + φ) passes through an ideal envelope detector (rectifier + low-pass filter with ideal frequency response), the output recovers the original modulation:

                                                        A(t) = A_c * [1 + μ * m(t)]

                                                        Proof: The detector output tracks the envelope A(t). If the low-pass filter cuts off above the modulation bandwidth, the recovered signal is purely A(t), and thus contains the original m(t).

                                                        Ideal detector assumptions:

                                                        1. Perfect rectification (no forward voltage drop or threshold)
                                                        2. Ideal low-pass filter (brick-wall response at modulation bandwidth)
                                                        3. No noise or interference
                                                        4. No overmodulation (μ ≤ 1)

                                                        Real detectors degrade due to:

                                                        1. Finite forward drop (amplitude bias)
                                                        2. Nonzero threshold (amplitude offset)
                                                        3. Nonideal filtering (ripple, transition band)
                                                        4. Nonlinear transfer function

                                                        This lemma formalizes the ideal case, which serves as a reference for calculating real detector efficiency losses.