avian2 / spectrum-sensing-methods

Experiments with spectrum sensing methods
GNU General Public License v3.0
33 stars 14 forks source link

any reference for the Sx matrix in spectrum-sensing-methods/sensing/utils.py #1

Open Jingyi-li opened 3 years ago

Jingyi-li commented 3 years ago

Hi, I have some problem with the Spectral correlation density function. And I found that in your code you have made your SX. I want to know if you have any reference about how to arrange the result of the Second FFT to get the Sx. Thank you very much.

avian2 commented 3 years ago

Hi. Have you look at the paper linked in the README file? You will find a list of references there.

Jingyi-li commented 3 years ago

Thanks a lot for your reply. I saw the paper in the README which is great. I am curious that your figure 3 is symmetrical both in frequency and alpha. But in my simulation, the value only exactly symmetry in alpha but not in frequency. And the Matrix size of my SCD is 2N*2Np. If it is ok could you please explain to me how you set this?

Sx = np.zeros((Np, 2*N), dtype=complex) Mp = N/Np/2

for k in range(Np):
    for l in range(Np):
        XF2 = np.fft.fft(XD[:,k]*np.conjugate(XD[:,l]))
        XF2 = np.fft.fftshift(XF2)
        XF2 /= P

        i = int( (k+l)/2. )
        a = int( ((k-l)/float(Np) + 1.)*N )

        **Sx[i,a-Mp:a+Mp] = XF2[P/2-Mp:P/2+Mp]**

return Sx

In my code I follow the theory like this from paper "Bidyanta, N., Vanhoy, G., Hirzallah, M., Akoglu, A., Ryu, B.,Bose, T. (2015). Gpu and fpga based architecture design forreal-time signal classification. Proceedings of the 2015 WirelessInnovation Forum Conference on Wireless CommunicationsTechnologies and Software Defined Radio (WInnComm’15) (pp.70–79). San Diego."

Screenshot from 2021-04-19 11-21-03

avian2 commented 3 years ago

You are probably using a complex input signal. I'm using real-valued signals, which is why my FFTs are symmetrical on the frequency axis.