2

I have to analyse a signal which has been modulated with a QPSK using matlab and I can't seem to get things right.

What I have: a complex signal sampled at a known frequency.

What I want: the power ratio of a certain frequency. So if the signal is of the form a*cos(wt)+a*cos(2wt) then I should get 0.5 for w and 0.5 for 2w.

I don't know where is the problem with my code but I get a frequency power higher than the signal power as you can see it in the graph bellow (in blue: signalPower, in red: Fm).

Signal power vs Frequency Power

And here is my code:

% Nsym : Number of symbol used for the detection
% Ns : Number ofsamples per symbol
% IQrx : Complex signal to analyse
% Fmod : Modulation frequency

Nt = Nsym*Ns;
signalPower = zeros(1, length(IQrx));
Fp = zeros(1, length(IQrx));
Fm = zeros(1, length(IQrx));
for ii = 1:length(IQrx)
    for jj = 0:Nt-1
        if ii-jj > 0 && ii-jj <= length(IQrx)
            signalPower(ii) = signalPower(ii) + ...
                abs(IQrx(ii-jj))^2;
            Fp(ii) = Fp(ii) + ...
                IQrx(ii-jj) * ...
                exp(1i*2*pi*Fmod*(ii-jj)/obj.Fs);
            Fm(ii) = Fm(ii) + ...
                IQrx(ii-jj) * ...
                exp(-1i*2*pi*Fmod*(ii-jj)/obj.Fs);
        end
    end
    Fp(ii) = abs(Fp(ii))^2;
    Fm(ii) = abs(Fm(ii))^2;
end

Edit: As requested in the comments the formulas that I use are: Consider that i goes in the time window of interest.

signalPower = sum ( signal(i)^2 )

Fp = abs( sum( signal * exp(1i*2*piFmod(i)/obj.Fs) ) )^2

Fp = abs( sum( signal * exp(-1i*2*piFmod(i)/obj.Fs) ) )^2

Leo
  • 1,129
  • 4
  • 23
  • 38
  • Looks like you're convolving your signal with the magnitude squared of the received signal and also convolving the received signal with a dirac delta in the time domain, and taking the magnitude squared each loop. Can you reference what formula you are using to determine spectral power? – macduff Jun 26 '13 at 15:25
  • @macduff I referenced the formulas as you suggested! – Leo Jun 26 '13 at 15:32
  • This really belongs on dsp.stackexchange.com – Bjorn Roche Jun 26 '13 at 20:01
  • @BjornRoche I didn't know it existed. I'll post it there then. Should I delete this thread too? – Leo Jun 27 '13 at 07:39
  • Since you have an answer, I wouldn't do anything. But in the future, for similar questions, you know what to do :) – Bjorn Roche Jun 27 '13 at 12:43

1 Answers1

0

Seems to me that

signalPower(ii) = signalPower(ii) + abs(IQrx(ii-jj))^2;

Should be something more like:

signalPower(ii) = signalPower(ii) + abs(IQrx(ii-jj));

You might want to try something a bit simpler for the signal power like:

pwt=x'*x; % Power in time domain

where x is your windowed time series value. (inspiration from this link).

macduff
  • 4,655
  • 18
  • 29