J'essaie de minimiser le bruit des valeurs CSI. J'ai généré de fausses valeurs CSI et j'y ai ajouté une erreur aléatoire.
Je donne le code
import numpy as np
#import tkinter as Tk
import scipy as sp
import matplotlib.pyplot as plt
from scipy import signal
from scipy.fftpack import fft
#Generate fake CSI values
csi_values =np.array([0 + 0j]*64)
print(csi_values)
csi_values[13] = .5 + .2j
csi_values[12] = .75 + .25j
csi_values[11] = 1 + .35j
csi_values[10] = 1.5 + .5j
print(csi_values[10:14:1])
print(csi_values)
fft_value = fft(csi_values)
print(fft_value)
print(len(fft_value))
#print(fft_value)
real_csi= abs(csi_values)
mean_csi= np.mean(real_csi)
print(real_csi)
print(mean_csi)
x_axis = np.linspace(0.0, 63,64)
print(x_axis.shape,fft_value.shape)
plt.plot(abs(fft_value))
plt.grid()
plt.show()
#CSI Subcarrier selection based on average amplitude of all subcarriers
csi_truncated = csi_values[abs(csi_values) > mean_csi]
print(csi_truncated)
#Removal of noise using median filter
csi_error= csi_values + np.random.rand(64)
print(csi_error)
trim_csi = sp.signal.medfilt(csi_error,5)
Cependant, j'obtiens l'erreur suivante
File "python_check.py", line 54, in <module>
trim_csi = sp.signal.medfilt(csi_error,5)
File "/home/avishek/venv3/lib/python3.5/site-packages/scipy/signal/signaltools.py", line 893, in medfilt
return sigtools._order_filterND(volume, domain, order)
ValueError: order_filterND not available for this type
Quelle est la raison de cette erreur ? J'utilise les bons paquets aussi, je suppose