FUsignal¶
-
class
pylayers.signal.bsignal.
FUsignal
(x=array([], dtype=float64), y=array([], dtype=float64), label=[])[source]¶ Bases:
pylayers.signal.bsignal.FBsignal
,pylayers.signal.bsignal.Usignal
FUsignal : Uniform signal in Frequency Domain
x : nd.array((1xN)) y : Complex nd.array((… x N )
symH : force Hermitian symetry –> FHsignal symHz : force Hermitian symetry with zero padding –> FHsignal align : align two FUsignal on a same frequency base enthrsh : Energy thresholding thresh = 99.99 % dBthrsh : dB thresholding thresh = 40dB ift : Inverse Fourier transform resample : resampling with a new base newdf : resampling with a new df zp : zero padding until len(x) = N plotri : plot real part and imaginary part plotdB : plot modulus in dB get : get k th ray window :
Methods Summary
apply Friis factor
dBthrsh
([threshdB])dBthrsh : dB thresholding of an FUsignal
decimate
([N])decimate FUsignal by N Parameters ———- N : int decimation factor (default 2)
dftresamp
(df_new)non finished
electrical_delay
(tauns)energy
([axis, Friis, mode])calculate energy along a given axis of the FUsignal
enthrsh
([thresh])Energy thresholding of an FUsignal
get
(k)get the kth signal from the FUsignal
ifft
([Npt])Inverse Fourier transform
ift
([Nz, ffts, beta])Inverse Fourier Transform - returns the associated TUsignal
iftshift
([Nz])Return the associated TUsignal
info
()Display Information about the FUsignal
newdf
(df)resample the FUsignal using phase and module interpolation
show
(**kwargs)imshow visualization of Modulus and Phase
symH
([parity])enforce Hermitian symetry
symHz
(Nz[, scale])Force Hermitian symmetry with zero padding
tap
(**kwargs)calculates channel taps
zp
(N)zero padding until length N
Methods Documentation
-
applyFriis
()[source]¶ apply Friis factor
The Friis factor is multiplied to y
\[ \begin{align}\begin{aligned}y := \( \frac{-j c}{4 \pi f} \) y\\x is frequency in GHz\end{aligned}\end{align} \]boolean isFriis is set to True
-
energy
(axis=-1, Friis=False, mode='mean')[source]¶ calculate energy along a given axis of the FUsignal
axis : (default 0) Friis : boolean mode : string
mean (default) | center | integ | first | last
>>> ip = TUsignal() >>> ip.EnImpulse() >>> En1 = ip.energy() >>> assert((En1>0.99) & (En1<1.01))
If Friis is true energy is multiplied by
\(\frac{-j*c}{4 pi fGHz}\)
axis = 0 is ray axis
if mode == ‘mean’
\(E=\frac{1}{K} \sum_k |y_k|^2\)
if mode == ‘integ’
\(E=\delta_x \sum_k |y_k|^2\)
if mode == ‘center’
\(E= |y_{K/2}|^2\)
-
enthrsh
(thresh=99.99)[source]¶ Energy thresholding of an FUsignal
- threshfloat
threshold in percentage (default 99.99)
EMH2 : cumul energie H
-
ifft
(Npt=-1)[source]¶ Inverse Fourier transform
- Nptint
default -1 (same number as x)
tc : TUsignal
\[x = \textrm{linspace}(0,\frac{1}{\delta f},N)\]\[y = [0,\mathbb{X}_u^T]\]
-
ift
(Nz=1, ffts=0, beta=0)[source]¶ Inverse Fourier Transform - returns the associated TUsignal
Nz : Number of zeros (-1) No forcing ffts : 0 (no fftshift 1:fftshift) beta : kaiser window shape
0 : rectangular 5 : similar to a Hamming 6 : similar to a Hanning 8.6 : similar to a blackman
uh :
>>> from pylayers.signal.bsignal import * >>> e = TUsignal() >>> e.EnImpulse() >>> E = e.fft() >>> EU = E.unrex()
1 - Force Hermitian symmetry –> FHsignal with or without zero padding 2 - Inverse Fourier transform with or without fftshift
FHsignal.ifft, FUsignal.symH, FUsignal.symHz
-
iftshift
(Nz=1)[source]¶ Return the associated TUsignal
apply the inverse fftshift operator to come back in time
-
symHz
(Nz, scale='extract')[source]¶ Force Hermitian symmetry with zero padding
- Nzint
Number of zero above f[-1]
- scalestring
default : ‘extract’ | ‘cir’
SH : FHsignal
The signal is rescaled in order to conserve energy
Let denotes the FUsignal as \(mathcal{X}_d\) The Fourier matrix is :math:`left[ matrix{mathbb{1}\
mathbb{W}_d\ mathbb{W}_u}right]`
FHSignal
>>> N = 11 >>> x = np.linspace(2,11,N) >>> y1 = sp.randn(N)+1j*sp.rand(N) >>> y2 = sp.randn(N)+1j*sp.rand(N) >>> y1[0] = 0 >>> y2[0] = 0 >>> y = np.vstack((y1,y2)) >>> S = FUsignal(x,y) >>> FH = S.symHz(10)
-
tap
(**kwargs)[source]¶ calculates channel taps
- fcGHzfloat
center frequency GHz
- WGHzfloat
bandwidth GHz
Ntap : number of taps baseband : boolean
default : True
htapi
[Tse] David Tse, http://www.eecs.berkeley.edu/~dtse/Chapters_PDF/Fundamentals_Wireless_Communication_chapter2.pdf page 26
-