test_cases3.py
35 lines
| 1.2 KiB
| text/x-python
|
PythonLexer
/ SRC / test_cases3.py
Alexis Jeandet
|
r0 | #Operations with float numbers# | |
import numpy as np | |||
from filters import * | |||
from bin16 import * | |||
from fft import * | |||
import math | |||
import cmath | |||
import matplotlib.pyplot as plt | |||
from basic_parameters import * | |||
# The parameters who describe the magnetic field B are 'a' and 'b', | |||
# who shall form a complex phasor given by: [a -b*1j 0] * exp(1j * (w*t + phi)) | |||
a = np.random.random() # we take a value at random between 0 and 1 | |||
b = np.sqrt(1 - a*a) # we want to force a^2 + b^2 = 1 | |||
# 'f' is the frequency of oscillation of our electromagnetic wave, who's monochromatic for now | |||
f = 2500 | |||
# 'l' is the wavelength of the electromagnetic wave | |||
l = 3000 | |||
# is the propagating vector, who's related to the k vector | |||
n = [1,1,1] | |||
# is a vector who tells us the degree of polarization of the medium where the electromagnetic wave is being propagated | |||
E_para = [0,0,0] | |||
# 'fm' is the original sampling frequency (the one who enters the LFRß) | |||
fm = 98304 | |||
# this function will give us: | |||
# - A list of Spectral Matrices: S = [S1, S2, S3] | |||
# - A list of Angular Frequencies: w = [w1, w2, w3] | |||
# - The possibility of plotting and saving the graphs for each value of fm (24576 Hz, 4096 Hz, 256 Hz) | |||
S,w = SpectralMatrice_Monochromatic(a,b,n,E_para,f,fm,l) |