0
$\begingroup$

I am trying to create a small simulation where I would need to transmit a wireless signal from one wireless node to another and then transmit one more message back to node 1. Considering this is LR-WPAN device, the IEEE standard is 802.15.4 and signal supposed to be O-QPSK modulated. I use the in-built function which is

lrwpan.PHYGeneratorOQPSK (message, spc, '2450 MHz');  

I defined a message myself according to MPDU format. However when I transfer my waveform into frequecy domain, my signal does not look wireless and have a drastical drop of amplitude every 400 Hz, so I am not sure if it is a normal thing or no. I also added AWGN noise to my signal and visualized the corresponding plots. I was wondering if someone can look at my plots and my code and confirm if my plots are fine and I do everything correct. Here is my code to generate two wireless signals:

clc,clear
spc = 4;              % symbols per chip

%mesage length is 18 bytes
message1_2 = [1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ...
    0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 ...
    0 1 1 0 1 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 1 1 ...
    0 0 1 1 1 0 1 0 0 0 1 0 0 1 0 0]';
message2_1 = [1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ...
    0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 ...
    0 1 1 0 1 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 1 1 ...
    1 0 1 1 1 0 1 1 1 1 0 1 1 0 0 0]';
% % O-QPSK PHY, 2450 MHz
waveform = lrwpan.PHYGeneratorOQPSK(message, spc, '2450 MHz');
SNR1 = -300;
waveform1 = lrwpan.PHYGeneratorOQPSK(message1_2, spc, '2450 MHz');
waveform2 = lrwpan.PHYGeneratorOQPSK(message2_1, spc, '2450 MHz');
waveform1 = std(waveform1)/std(waveform1)*(sqrt(10^(SNR1/10)))*waveform1; %% increase signal1 transmission power
waveform2 = std(waveform2)/std(waveform2)*(sqrt(10^(SNR1/10)))*waveform2; %% increase signal2 transmission power
%Calculate Number of FFT points
l = length(waveform1);
NFFT = 2.^nextpow2(l);
%take FFT of original signal
wavesignal1 = abs(fft(waveform1,NFFT)); %signal1
wavesignal2 = abs(fft(waveform2,NFFT)); %signal2
SNR= 35;    % average SNR for wireless sensor networks application
%applying white gaussian noise to both signals
S = RandStream('mt19937ar','Seed',5489);
%received signals
received_at_node2= awgn(waveform1, SNR, 'measured', S);
reset(S);
received_at_node1 = awgn(waveform2, SNR, 'measured', S);
reset(S);
%take FFT of received signal with noise
wave_fft_signal1 = abs(fft(received_at_node2,NFFT));
wave_fft_signal2 = abs(fft(received_at_node1,NFFT));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%SIGNAL PLOTS%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %signal 1 Dbm Spectrum plot
% 
%
%
% %original signal 1
XdB1 = 10*log10(wavesignal1);
subplot(2,2,1);
plot(f,XdB1(1:NFFT));
title('Wireless Signal 1 without Noise');
xlabel('Frequency (Hz)');
ylabel('|signal 1| (dBm)');
%
%
% %noisy signal 1
XdB1_n = 10*log10(wave_fft_signal1);
xdB1_f = 10*log10(filtered1);
subplot(2,2,2);
plot(f,XdB1_n(1:NFFT));
title('Wireless Signal 1 with AWGN applied');
xlabel('Frequency (Hz)');
ylabel('|signal 1| (dBm)');
% 
% %signal 2 Power Spectrum plot
%
%
%
%original signal 2
XdB2 = 10*log10(wavesignal2);
subplot(2,2,3);
plot(f,XdB2(1:NFFT),'color','black');
title('Wireless Signal 2 without Noise');
xlabel('Frequency (Hz)');
ylabel('|signal 1| (dBm)');
% 
%
%
% %noisy signal 2
XdB2_n = 10*log10(wave_fft_signal2);
subplot(2,2,4);
plot(f,XdB2_n(1:NFFT),'color','black');
title('Wireless Signal 2 with AWGN noise Applied');
xlabel('Frequency (Hz)');
ylabel('|signal 2| (dBm)');

I've read some papers related to wireless signal simulation and this is how their plots usually look like:

enter image description here

whereas my plots are as follows:

enter image description here

  • What am I doing wrong and how to bring it to the visual form that was depicted above?
  • Do I have to center it around 2.4 GHz?
  • If yes , how to do it?
  • Why does the amplitude go down so much every ~500 Hz?
$\endgroup$
  • $\begingroup$ as you may know, the spectrum of a digital transmission (with zero-mean symbols, which should be the case here) is only defined by the pulse shape. I don't know PHYGeneratorOQPSK, so which pulse shape does it use? $\endgroup$ – Marcus Müller May 13 at 8:25
  • $\begingroup$ @ Marcus Müller it is half sine pulse filtering, and that is already in-built in PhyGeneratorOQPSK function $\endgroup$ – ViniLL May 14 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.