Compare the spectra of two signals with infinite discontinuities

Wireless Discontinuity Signal Spectrum

 

01 Signal spectrum with


I. Introduction

  A question came to mind today, here are two signals with infinitely many discontinuities. They are all located between 0,1. The first signal starts from 0 and advances to 1, and the amplitude is reduced by half for every half of the remaining distance. The second signal is to advance from 0 to 1, each time advancing half of the remaining distance. A rectangular pulse signal whose width is half the length of the path appears during the advancing path. According to the Fourier transform, neither signal satisfies the Dirichlet condition. So what is their Fourier transform?
GM1681093387_1280_800.MPG|_-4

▲ Figure 1.1.1 The first type of discontinuity point function

▲ 图1.1.1 第一种间断点函数

▲ Figure 1.1.2 The second discontinuous point signal

▲ 图1.1.2 第二种间断点信号

from headm import *
t = linspace(-.25, 1.25, 100000)
ft = t*0

def G(t, startn, endn):
    return heaviside(t-startn,0.5)-heaviside(t-endn,0.5)
def Gt(t, center, width):
    startn = center-width/2
    endn = startn + width
    return heaviside(t-startn,0.5)-heaviside(t-endn,0.5)

'''
for n in range(100):
    ft = ft + 0.5**n*(heaviside(t-1+0.5**n,0)-heaviside(t-1+0.5**(n+1),0))
'''
'''
for n in range(100):
    startt = 1-(1/2)**n
    endt = 1-(1/2)**(n+1)
    centert = (endt+startt)/2
    lent = endt-startt

    ft = ft + Gt(t, centert, lent/2)
'''

for n in range(100):
    startt = 1-3*2**-(n+2)
    endt = 1-2**-(n+1)

    ft = ft + G(t, startt, endt)

plt.plot(t, ft, lw=2)

plt.xlabel("t")
plt.ylabel("f(t)")
plt.grid(True)
plt.grid(False)
plt.tight_layout()
plt.show()

2. Spectrum of signal 1

1. Spectrum derivation

  First obtain the spectrum of the first model. This is its mathematical expression. For each item in the series, it represents a rectangular pulse with a height of 2 to the negative nth power, a starting point of 1 minus 2 to the negative nth power, and an end point of 1 minus 2 to the negative n plus 1 power. Negative n with width 2 plus 1. Write down the spectrum of the pulse signal. Note that the signal should be centered at 1 minus 3 times 2 to the negative n minus 1 power. 

▲ Figure 1.2.1 The Fourier transform corresponding to each item of the series

▲ 图1.2.1 级数每一项对应的傅里叶变换

  For the spectrum of the original signal, it is necessary to add up the spectrum of each item of the series, so as to obtain the spectrum of the signal.  
GM1681094804_1280_800.MPG|_-18

  The following is the sorted spectrum formula:

▲ Figure 1.2.2 Fourier series decomposition formula of signal

▲ 图1.2.2 信号的傅里叶级数分解公式

▲ Figure 2.2 Amplitude spectrum of the first model

▲ 图2.2 第一个型号的幅度谱

2. Verification formula

  This is the finally derived signal spectrum formula, which is also a series. Let's verify this formula by discrete Fourier transform. This is through Python programming, taking the frequency between plus and minus 10,000, and using 100,000 spectrum data points for inverse transformation. Calculate the frequency spectrum series to take 100 levels. This is the calculated signal waveform. It can be seen that it is consistent with the given signal. There is an overshoot at 0, and all other discontinuous points have overshoot. Accordingly, not only the validity of this formula is verified, but also it can be roughly deduced that the formula should be convergent.
GM1681098900_1280_800.MPG|_-8

▲ Figure 1.2.3 The result of IFFT of the first signal

▲ 图1.2.3 第一个信号IFFT的结果

#!/usr/local/bin/python
# -*- coding: gbk -*-
#============================================================
# TEST2.PY                     -- by Dr. ZhuoQing 2023-04-10
#
# Note:
#============================================================
from headm import *
o = linspace(-10000, 10000, 100000)
os = (max(o)-min(o))/(len(o)-1)
t1 = 2*pi/os
o1 = max(o)-min(o)
ts = 2*pi/o1
tdim = linspace(-t1/2,t1/2, len(o))
#------------------------------------------------------------
N = 100
Fo = 0*o
for n in range(N):
    Fo = Fo + 2**(-2*n-1)*sinc(2**(-n-2)*o/pi)*exp(-1j*o*(1-3/4*2**(-n)))
ft = abs(fft.ifft(Fo))
ft = fft.fftshift(ft)/ts
c = len(o)//2
l = len(o)//20
st = c-l//4
ed = c+l+1*3//4
plt.plot(tdim[st:ed], ft[st:ed], lw=2)
plt.xlabel("t")
plt.ylabel("f(t)")
plt.grid(True)
plt.tight_layout()
plt.show()
#------------------------------------------------------------
#        END OF FILE : TEST2.PY
#============================================================

3. Signal 2 Spectrum

1. Spectrum derivation

  For the second signal, it is expressed in the form of an infinite series, in which the corresponding height of each signal is 1, but their width and position are different. This gives the start of the region where the signal is located and the start and end of the pulses within it. The spectrum of each pulse corresponds to the sinc function. These are added together to form the spectrum of the entire signal.
GM1681104813_1280_800.MPG|_-10

▲ Figure 1.3.1 Spectrum derivation of a single pulse

▲ 图1.3.1 单个脉冲的频谱推导

  The following is the signal waveform after derivation:

▲ Amplitude spectrum of the second signal

▲ 第二个信号的幅度谱

2. Verification formula

  In order to verify the correctness of this formula, still through Python programming, use the inverse discrete Fourier transform to obtain its corresponding waveform. Take the spectrum within plus or minus 10,000, sample 100,000 data points, and perform inverse Fourier transform to finally get the signal without waveform. This result preliminarily verifies the correctness of the formula. The convergence of this signal error will be verified by simulation later. On the left is the original signal waveform, and on the right is the signal waveform synthesized using finite spectrum.
GM1681105353_1280_800.MPG|_-5

▲ Figure 1.3.2 Approximate waveform of signal obtained using limited bandwidth

▲ 图1.3.2 使用有限带宽获得信号的近似波形

from headm import *

o = linspace(-10000, 10000, 100000)
os = (max(o)-min(o))/(len(o)-1)
t1 = 2*pi/os

o1 = max(o)-min(o)
ts = 2*pi/o1
tdim = linspace(-t1/2,t1/2, len(o))

N = 100
Fo = 0*o
for n in range(N):
    Fo = Fo + 2**-(n+2)*sinc(2**-(n+3)*o/pi)*exp(-1j*o*(1-3*2**-(n+2)))

ft = abs(fft.ifft(Fo))
ft = fft.fftshift(ft)/ts

c = len(o)//2
l = len(o)//20
st = c-l//4
ed = c+l+1*3//4

plt.plot(tdim[st:ed], ft[st:ed], lw=2)

plt.xlabel("t")
plt.ylabel("f(t)")
plt.grid(True)
plt.tight_layout()
plt.show()

 

Summary  ※


  This paper deduces the frequency spectrum of two signals with wireless discontinuities, both of which are in the form of infinite series, and uses discrete Fourier transform for numerical solution, and verifies the correctness of the frequency spectrum formula through simulation waveforms. The convergence of their spectra will be discussed later.
GM1681105651_1280_800.MPG|_-6

▲ Figure 2.1 Signal waveform and its spectrum

▲ 图2.1 信号波形及其频谱

from headm import *

o = linspace(-10000, 10000, 100000)
os = (max(o)-min(o))/(len(o)-1)
t1 = 2*pi/os

o1 = max(o)-min(o)
ts = 2*pi/o1
tdim = linspace(-t1/2,t1/2, len(o))

#------------------------------------------------------------

N = 100
Fo = 0*o
for n in range(N):
    Fo = Fo + 2**(-2*n-1)*sinc(2**(-n-2)*o/pi)*exp(-1j*o*(1-3/4*2**(-n)))
#    Fo = Fo + 2**-(n+2)*sinc(2**-(n+3)*o/pi)*exp(-1j*o*(1-3*2**-(n+2)))

#------------------------------------------------------------

Foa = abs(Fo)
c = len(o)//2
l = len(o)//20
st = c-l
ed = c+l

plt.plot(o[st:ed], Foa[st:ed], lw=3)

plt.xlabel("Omega")
plt.ylabel("abs(Fo)")
plt.grid(True)
plt.tight_layout()
plt.show()


● Links to related diagrams:

Guess you like

Origin blog.csdn.net/zhuoqingjoking97298/article/details/130053322