Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jingyi-li opened this issue Apr 18, 2021 · 3 comments

Comments

@Jingyi-li
Copy link

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
Copy link
Owner

avian2 commented Apr 18, 2021

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

@Jingyi-li
Copy link
Author

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
Copy link
Owner

avian2 commented Apr 19, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants