Documentation

Signals.Sampling

A sampling rate whose value is strictly positive.

  • hz : ℝ
  • positive : 0 < self.hz
Instances For

    A nonnegative one-sided bandwidth.

    • hz : ℝ
    • nonnegative : 0 ≤ self.hz
    Instances For

      The strict Nyquist condition for a bandwidth and sampling rate.

      Instances For
        def Signals.Sampling.InBand (bandwidth : Bandwidth) (frequency : ℝ) :

        A frequency lies in a symmetric band around the carrier.

        Instances For
          noncomputable def Signals.Sampling.sampleAngle (frequency rate phase : ℝ) (index : ℕ) :
          ℝ

          The phase of a complex I/Q tone at one sample index.

          Instances For
            noncomputable def Signals.Sampling.toneSample (amplitude frequency rate phase : ℝ) (index : ℕ) :

            A real-amplitude complex tone written as an I/Q sample.

            Instances For
              structure Signals.Sampling.SampledSignal (sampleCount : ℕ) :

              A finite sequence of receiver samples.

              Instances For
                noncomputable def Signals.Sampling.sampleTone (sampleCount : ℕ) (amplitude frequency rate phase : ℝ) :
                SampledSignal sampleCount

                Sample a tone at the indices of a finite receiver buffer.

                Instances For
                  def Signals.Sampling.reconstruct {sampleCount : ℕ} (signal : SampledSignal sampleCount) :
                  Fin sampleCount → IQ.Sample

                  The finite reconstruction operator returns the recorded samples exactly.

                  Instances For
                    theorem Signals.Sampling.reconstruct_exact {sampleCount : ℕ} (signal : SampledSignal sampleCount) (index : Fin sampleCount) :
                    reconstruct signal index = signal.values index

                    Reconstruction in the finite sample model is exact by construction.

                    def Signals.Sampling.aliasedFrequency (frequency : ℝ) (rate : SamplingRate) (aliasIndex : ℤ) :
                    ℝ

                    Frequencies separated by an integer multiple of the sampling rate.

                    Instances For
                      theorem Signals.Sampling.sampleAngle_aliased (frequency phase : ℝ) (rate : SamplingRate) (aliasIndex : ℤ) (index : ℕ) :
                      sampleAngle (aliasedFrequency frequency rate aliasIndex) rate.hz phase index = sampleAngle frequency rate.hz phase index + ↑aliasIndex * ↑↑index * (2 * Real.pi)

                      The sample angle changes by an integer number of full turns under aliasing.

                      theorem Signals.Sampling.toneSample_aliased (amplitude frequency phase : ℝ) (rate : SamplingRate) (aliasIndex : ℤ) (index : ℕ) :
                      toneSample amplitude (aliasedFrequency frequency rate aliasIndex) rate.hz phase index = toneSample amplitude frequency rate.hz phase index

                      Integer-rate aliases produce identical in-phase and quadrature samples.

                      theorem Signals.Sampling.sampleTone_aliased (sampleCount : ℕ) (amplitude frequency phase : ℝ) (rate : SamplingRate) (aliasIndex : ℤ) :
                      sampleTone sampleCount amplitude (aliasedFrequency frequency rate aliasIndex) rate.hz phase = sampleTone sampleCount amplitude frequency rate.hz phase

                      A finite sampled tone is unchanged by a whole-rate frequency alias.

                      theorem Signals.Sampling.no_one_rate_alias {bandwidth : Bandwidth} {rate : SamplingRate} (nyquist : NyquistCondition bandwidth rate) {frequency₁ frequency₂ : ℝ} (frequency₁_in_band : InBand bandwidth frequency₁) (frequency₂_in_band : InBand bandwidth frequency₂) (frequency_alias : frequency₂ = frequency₁ + rate.hz) :
                      False

                      Strict Nyquist sampling prevents two in-band frequencies from differing by one rate.

                      theorem Signals.Sampling.nyquist_condition_iff {bandwidth : Bandwidth} {rate : SamplingRate} :
                      NyquistCondition bandwidth rate ↔ 2 * bandwidth.hz < rate.hz

                      The strict Nyquist condition is equivalent to the displayed bandwidth inequality.