Tchannel

class pylayers.antprop.channel.Tchannel(x=array([0, 1]), y=array([0, 1]), tau=array([], shape=(1, 0), dtype=float64), dod=array([], shape=(0, 2), dtype=float64), doa=array([], shape=(0, 2), dtype=float64), label='')[source]

Bases: pylayers.signal.bsignal.FUsignal

Handle the transmission channel

The transmission channel TChannel is obtained through combination of the propagation channel and the antenna transfer functions from both transmitter and receiver. This channel contains all the spatial information for each individual ray. Warning : This is a frequency domain channel deriving from bs.FUsignal

ray transfer functions (nray,nfreq)

dod :

direction of depature (rad) [theta_t,phi_t] nray x 2

doa :

direction of arrival (rad) [theta_r,phi_r] nray x 2

tau :

delay ray k in ns

imshow() apply(W) applywavB(Wgam) applywavC(Wgam) chantap(fcGHz,WGHz,Ntap) doddoa() wavefig(w,Nray) rayfig(w,Nray) rssi(ufreq)

pylayers.antprop.Ctilde.prop2tran

Methods Summary

apply([W])

apply FUsignal W to the Tchannel

applywav([Wgam])

apply waveform (time domain ) to obtain the rays impulses response

applywavA(Wgam, Tw)

apply waveform method A

applywavB(Wgam)

apply waveform method B (time domain )

applywavC(w, dxw)

apply waveform method C DEPRECATED

baseband(**kwargs)

Channel transfer function in baseband

calibrate([filecal, conjugate])

calibrate data

capacity(Pt[, T, mode])

calculates channel Shannon capacity (no csi)

chantap(**kwargs)

channel tap

cut([threshold])

cut the signal at an Energy threshold level

doadod(**kwargs)

doadod scatter plot

energy([mode, sumray])

calculates channel energy including antennas spatial filtering

field()

frombuf(S[, sign])

load a buffer from vna

ft1(Nz[, ffts])

construct CIR from ifft(RTF)

ft2([df])

build channel transfer function (frequency domain)

ftau([Nz, k, ffts])

time superposition

get_cir([Wgam])

get Channel impulse response of the channel

getcir([BWGHz, Nf, fftshift])

get the channel impulse response

ifft()

inverse Fourier Transform

iftd([Nz, tstart, tstop, ffts])

time pasting

loadh5(Lfilename, idx[, output])

load Ctilde object in hdf5 format

pdp([win, calibrate])

calculates power delay profile

plot3d([fig, ax])

plot in 3D

plotad([a])

plot angular delays

plotd([d])

plot direction of arrival and departure

rayfig(k, W[, col])

build a figure with rays

rir(Nz[, ffts])

construct ray impulse response

rssi([ufreq])

Compute RSSI value for a frequency index

saveh5(Lfilename, idx, a, b, Ta, Tb)

save Ctilde object in hdf5 format

showtap(**kwargs)

show tap

sort([typ])

sort FUD signal

tap(**kwargs)

calculate channel tap

totime([Nz, ffts])

transform to TUDchannel

wavefig(w[, Nray])

display

Methods Documentation

apply(W=[])[source]

apply FUsignal W to the Tchannel

W : Bsignal.FUsignal

It exploits multigrid convolution from Bsignal.

V : FUDAsignal

Returns \(W(f) H_k(f)\)

  • W may have a more important number of points and a smaller frequency band.

  • If the frequency band of the waveform exceeds the one of the

transmission channel, a warning is sent. + W is a FUsignal whose shape doesn’t need to be homogeneous with FUChannel H

applywav(Wgam=[])[source]

apply waveform (time domain ) to obtain the rays impulses response

Wgam : waveform

rirarray,

impulse response for each ray separately the size of the array is (nb_rays, support_length) support_length is calculated in regard of the delays of the channel

The overall received signal is built in time domain

Wgam is applied on each Ray Transfer function

pylayers.signal.channel.rir

applywavA(Wgam, Tw)[source]

apply waveform method A

DEPRECATED

Wgam : Tw :

The overall received signal is built in frequency domain

pylayers.signal.bsignal

applywavB(Wgam)[source]

apply waveform method B (time domain )

DEPRECATED

Wgam : waveform

ri : TUDsignal

impulse response for each ray separately

The overall received signal is built in time domain

Wgam is applied on each Ray Transfer function

pylayers.signal.bsignal.TUDsignal.ft1

applywavC(w, dxw)[source]

apply waveform method C DEPRECATED

w :

waveform

dxw :

The overall received signal is built in time domain w is apply on the overall CIR

baseband(**kwargs)[source]

Channel transfer function in baseband

fcGHz : center frequency WMHz : bandwidth in MHz Nf : Number of frequency points

calibrate(filecal='calibration.mat', conjugate=False)[source]

calibrate data

filecalstring

calibration file name “calibration.mat”

conjugateboolean

default False

capacity(Pt, T=290, mode='blast')[source]

calculates channel Shannon capacity (no csi)

Pt : Power transmitted T : Temperature (Kelvin) mode : string

C : Channel capacity (bit/s)

chantap(**kwargs)[source]

channel tap

fcGHz : center frequency WGHz : bandwidth Ntap : int

cut(threshold=0.99)[source]

cut the signal at an Energy threshold level

thresholdfloat

default 0.99

doadod(**kwargs)[source]

doadod scatter plot

phi: tuple (-180, 180)

phi angle

normalize: bool

energy normalized

reversebool

inverse theta and phi represenation

polarbool

polar representation

cmap: matplotlib.cmap mode: ‘center’ | ‘mean’ | ‘in’

see bsignal.energy

sfloat

scatter dot size

fontsize: float edgecolors: bool colorbar bool

scatter plot of the DoA-DoD channel structure the energy is colorcoded over all couples of DoA-DoD

energy(mode='mean', sumray=False)[source]

calculates channel energy including antennas spatial filtering

modestring

center | mean | integ (different manner to get the value)

Friisboolean

apply the Frris coeff(2/(4p pi f)

sumray: boolean

ray energy cummulation indicator

field()[source]
frombuf(S, sign=-1)[source]

load a buffer from vna

S : buffer sign : int (+1 |-1) for complex reconstruction

ft1(Nz, ffts=0)[source]

construct CIR from ifft(RTF)

Nz : number of zeros for zero padding ffts : fftshift indicator

0 no fftshift 1 apply fftshift

r : TUsignal

pylayers.signal.bsignal.

ft2(df=0.01)[source]

build channel transfer function (frequency domain)

dffloat

frequency step (default 0.01)

  1. get fmin and fmax

  2. build a new base with frequency step df

  3. Initialize a FUsignal with the new frequency base

  4. build matrix tau * f (Nray x Nf)

  5. buildl matrix E= exp(-2 j pi f tau)

  6. resampling of FUDsignal according to f –> S

  7. apply the element wise product E .* S

  8. add all rays

ftau(Nz=0, k=0, ffts=0)[source]

time superposition

Nz : number of zeros for zero padding k : starting index ffts = 0 no fftshift ffts = 1 apply fftshift

r : TUsignal

get_cir(Wgam=[])[source]
get Channel impulse response of the channel

for a given waveform

Wgam : waveform

ri : TUsignal

impulse response for each ray separately

pylayers.antprop.channel.rir

getcir(BWGHz=1, Nf=40000, fftshift=False)[source]

get the channel impulse response

BWGHz : Bandwidth Nf : Number of frequency points fftshift : boolean

pylayers.simul.link.DLink.plt_cir

ifft()[source]

inverse Fourier Transform

>>> from pylayers.simul.link import *
>>> L = DLink(verbose=False)
>>> aktk = L.eval(force=True)
>>> L.H.cut()
>>> #T1 = L.H.totime()
>>> #f,a = T1.plot(typ='v')
>>> #L.H.minphas()
>>> #T2 = L.H.totime()
>>> #f,a = T2.plot(typ='v')
iftd(Nz=1, tstart=-10, tstop=100, ffts=0)[source]

time pasting

Nzint

Number of zeros

tstart : float tstop : float ffts : int

fftshift indicator

rf : TUsignal (1,N)

TUsignal.translate

loadh5(Lfilename, idx, output=True)[source]

load Ctilde object in hdf5 format

Lfilenamestring

Layout filename

idxint

file identifier number

outputbool

return an output precised in return

if output: (a,b,Ta,Tb)

with
a = np.ndarray

position of point a (transmitter)

b = np.ndarray

position of point b (receiver)

Ta = np.ndarray

rotation matrice of antenna a

Tb = np.ndarray

rotation matrice of antenna b

pdp(win='hamming', calibrate=True)[source]

calculates power delay profile

winstring

window name

plot3d(fig=[], ax=[])[source]

plot in 3D

>>> from pylayers.signal.bsignal import *
>>> import numpy as np
>>> N = 20
>>> fGHz = np.arange(1,3,1)
>>> taud = np.sort(np.random.rand(N))
>>> alpha = np.random.rand(N,len(fGHz))
>>> #s = Tchannel(x=fGHz,y=alpha,tau=taud)
>>> #s.plot3d()

(Source code)

plotad(a='phi', **kwargs)[source]

plot angular delays

Parameters

d: ‘doa’ | ‘dod’

display direction of departure | arrival

typ‘ns’ | ‘m’

display delays in nano seconds ( ns) or meter (m)

fig : plt.figure ax : plt.axis a : str

angle ‘theta’ | ‘phi’

normalize: bool

energy normalized

reversebool

inverse theta and phi represenation

polarbool

polar representation

cmap: matplotlib.cmap mode: ‘center’ | ‘mean’ | ‘in’

see bsignal.energy

sfloat

scatter dot size

fontsize: float edgecolors: bool colorbar: bool titel : bool ‘clipval’: float

remove values below clipval in dB

plotd(d='doa', **kwargs)[source]

plot direction of arrival and departure

d: ‘doa’ | ‘dod’

display direction of departure | arrival

fig : plt.figure ax : plt.axis phi: tuple (-180, 180)

phi angle

normalize: bool

energy normalized

reversebool

inverse theta and phi representation

polarbool

polar representation

cmap: matplotlib.cmap mode: ‘center’ | ‘mean’ | ‘in’

see bsignal.energy

sfloat

scatter dot size

fontsize: float edgecolors: bool colorbar: bool title : bool

rayfig(k, W, col='red')[source]

build a figure with rays

k : ray index W : waveform (FUsignal)

W is apply on k-th ray and the received signal is built in time domain

rir(Nz, ffts=0)[source]

construct ray impulse response

Nz : number of zeros for zero padding ffts : fftshift indicator

0 no fftshift 1 apply fftshift

rir : TUsignal

pylayers.signal.bsignal.

rssi(ufreq=0)[source]

Compute RSSI value for a frequency index

ufreqint

index in the frequency range

PrdB: float

RSSI value in dB $$10log_10 |a_k|^2$$

PrpdBfloat

RSSI in a tap over a frequency band ufreq $$10log_10 |a_k e^{-2j pi f au|^2$$

This function will be deprecated by energy function

saveh5(Lfilename, idx, a, b, Ta, Tb)[source]

save Ctilde object in hdf5 format

Lfilenamestring

Layout filename

Tilde

file identifier number

anp.ndarray

postion of point a (transmitter)

bnp.ndarray

postion of point b (receiver)

Tanp.ndarray

rotation matrice of antenna a

Tbnp.ndarray

rotation matrice of antenna b

showtap(**kwargs)[source]

show tap

same as tap

tap

sort(typ='tau')[source]

sort FUD signal

typstring
which parameter to sort ‘

‘tau’ : (default) ‘energy’

tap(**kwargs)[source]

calculate channel tap

fcGHzfloat

center frequency

WMHzfloat

bandwidth

Ntapint

number of taps (related to bandwith) as the bandwith increases the potential number of taps increases

Nsint

number of spatial realizations

Nmint

number of time samples the channel is sampled along a distance of half a wavelength

Va : velocity of link termination a Vb : velocity of link termination b theta_va : float

theta velocity termination a (in radians)

phi_va :

phi velocity termination a (in radians)

theta_vb:

theta velocity termination b (in radians)

phi_vb :

phi velocity termination b (in radians)

>>> from pylayers.signal.bsignal import *
totime(Nz=1, ffts=0)[source]

transform to TUDchannel

Nzint

Number of zeros for zero padding

fftsnt

fftshift indicator (default 0 )

>>> #from pylayers.simul.link import *
>>> #L = DLink(verbose=False)
>>> #aktk = L.eval()
>>> #L.H.cut()
>>> #T1 = L.H.totime()
>>> #f,a = T1.plot(typ='v')
>>> #L.H.minphas()
>>> #T2 = L.H.totime()
>>> #f,a = T2.plot(typ='v')

FUsignal.ift

wavefig(w, Nray=5)[source]

display

w : waveform Nray : int

number of rays to be displayed