| Author |
Message |
dkumar
Joined: 04 Jan 2008 Posts: 26 Helped: 1
|
08 May 2008 6:32 Spectrum of digital levels. |
|
|
|
HI!
Please somebody resolve my problem of finding the spectrum of logic levels obtained form ADC output.I am actually testing a RF chip where i gave input as sine wave and obtained the output form ADC placed at the end of receiver chain.
But to confirm to its proper functionality i need to find the spectrum of these so obtained digital levels.I know i may have to do some math but please if someone can put little input on what math do i have to do to get the spectrum it would be a great help.
Looking for help.
Thanks in advance.
-dk
|
|
| Back to top |
|
 |
dkumar
Joined: 04 Jan 2008 Posts: 26 Helped: 1
|
12 May 2008 10:01 Re: Spectrum of digital levels. |
|
|
|
Please resolve my trouble if some one has any idea about the above mentioned problem....Its very urgent...
Looking doe reply
-dk
|
|
| Back to top |
|
 |
RFDave
Joined: 18 Feb 2004 Posts: 315 Helped: 43 Location: NE USA
|
15 May 2008 23:43 Re: Spectrum of digital levels. |
|
|
|
Is there a reason you can't use an FFT to look at the spectrum?
Dave
|
|
| Back to top |
|
 |
dkumar
Joined: 04 Jan 2008 Posts: 26 Helped: 1
|
19 May 2008 20:33 Re: Spectrum of digital levels. |
|
|
|
Actually the output of ADC is 4 bit I and Q component.Say Q is all zero and I is 4 bot binary output. now how will i find the fft of this bit stream. in matlab???
i mean usinf abs(fftX) where X is bit stream doesn't seem reasonable to me.
Please tell me how should i do.
(The input to Receiver chin is MSK modulated data or unmoderated sine wave.)
|
|
| Back to top |
|
 |
RFDave
Joined: 18 Feb 2004 Posts: 315 Helped: 43 Location: NE USA
|
22 May 2008 4:11 Re: Spectrum of digital levels. |
|
|
|
You have a set of 4 bit samples, each with a sample time, right? you can scale them to between 0 and 1, and feed that into fft (I'm partial to using pwelch myself). You don't even have to scale them, you have 16 different levels.
Why isn't it reasonable? Extracting exact power levels from this is a bit tricky, but that is left as an exercise for the student (Hint, the time domain power and the frequency domain power are the same)
Dave
|
|
| Back to top |
|
 |
priyankguddu
Joined: 04 Feb 2005 Posts: 85 Helped: 6
|
23 May 2008 20:49 Re: Spectrum of digital levels. |
|
|
|
I will try to help
1) U r sampling some analog signal say x(t) with some sampling rate say Fs (let Ts = 1/Fs) .. Be confirmed about the Nyquist criterion (both Frequency of x(t) and the bandwidth).. now suppose you have done it correctly
2) there is 4 bit ADC i.e u have a quantiser and follow the levels to determine 1 and 0 for this .. so u will have x(nTs) comming in.. Now let for example u have a 33 KHz sampling rate .. so in 1 ms u will have 30 samples .. if u have a fair IDEA that ur signal is near base band or have no extra frequency component say doppler etc then what you do.. u collect say 4 ms of data .. i.e 120 sample and pad 8 zeros in that.. then perform 128 point Real FFT.. if there is no other signal present .. u will find your FFT peak at the freqency of x(t).
3) if there is some other frequncy u may find other peaks also .. at some fft bin.. then from bin number u can find the frequency ...
|
|
| Back to top |
|
 |
Slayerza
Joined: 23 Oct 2005 Posts: 326 Helped: 22 Location: South Africa
|
26 May 2008 7:57 Re: Spectrum of digital levels. |
|
|
|
I agree with priyankguddu insofar as using the FFT. However since you are using both I and Q phases (from your previous post I assume you sample individually) you will have to do the FFT twice. Once for the I phase and once for the Q phase. Ideally one could assume that the Q phase is shifted 90deg but that is only theoretical and as such I would perform two FFTs just to verify this.
Cheers
Slayer
|
|
| Back to top |
|
 |
echo47
Joined: 07 Apr 2002 Posts: 4203 Helped: 563
|
26 May 2008 10:12 Re: Spectrum of digital levels. |
|
|
|
MATLAB's FFT accepts complex data, so you can feed your 4-bit complex (I Q) data directly into the FFT.
This example generates a two-tone complex test signal, quantizes it to approximately 4-bits, then plots the FFT. Phase info is also available in the FFT result, although I didn't plot it here.
| Code: |
clear;
F1 = 17; % signal 1 frequency
F2 = 13; % signal 2 frequency
A1 = 2.5; % signal 1 amplitude
A2 = 4.5; % signal 2 amplitude
FS = 100; % sample rate
N = 100; % data samples
signal = round(A1 * exp(2j * pi * F1 * (1:N) / N) + A2 * exp(2j * pi * F2 * (1:N) / N));
subplot(2,1,1); plot(1:N, real(signal), 1:N, imag(signal));
set(gca,'YGrid','on'); xlabel('sample'); ylabel('amplitude'); ylim([-8 +7]);
%
spectrum = fftshift(fft(signal));
freq = FS * (-N/2 : N/2-1) / N;
magnitude = abs(spectrum) / N;
subplot(2,1,2); plot(freq, magnitude);
set(gca,'YGrid','on'); xlabel('frequency'); ylabel('amplitude') |
|
|
| Back to top |
|
 |