cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

How to take FFT of I and Q Data

Maxplus12
6-Contributor

How to take FFT of I and Q Data

Hello,

I have captured I-phase and Q-phase (quadrature) data of a radio signal with QPSK modulation.  The two data are in two separate text files with an array of data in a list.

How do I do FFT using Mathcad please?

Thank you

56 REPLIES 56

Use the cfft or the CFFT (note the capitals) command (depends on your needs and your data)

Guess that no more could be said without more information from your side.

Maxplus12
6-Contributor
(To:Werner_E)

Hi
Thank you.

I have seen that post and used a waveform (I believe it was a cosine) ad an example.

But I have I an Q data in text files containing 2000 data pair values to represent the complex signal. So effectively I and Q are complex.
How do I do FFT?

Hi,

 

further information makes this simple.  

https://dsp.stackexchange.com/questions/19615/converting-raw-i-q-to-db

Converting raw I/Q to dB

The amplitude of an IQ signal is just the vector magnitude, sqrt(I^2+Q^2)

Then do the fft on this amplitude. The complex numbers will turn to real in the squaring of the values.

 

Cheers

 

Hello

Thank you.

How do I use the CFFT command to take the FFT of a complex value? Remember there are about 4000 complex values.

If it's complex then you have phase information.

Capture.PNG

There are equivalent functions in Mathcad

Thank you. But there about 4000 is data values in the text file.

I guess I need to read the file and apply FFT.

What is the syntax formst for using fft in mathcad when reading the file or an array of data values?

See example attached

Thank you.  Unfortunately, I am unable to open the document.  The message states Failed to Open Document.

I am using Mathcad 14.0 M035 (14.0.3.374).

Is there any another way to open?

Hi,

Perhaps if you upload your data we can show you how to do it in Mathcad 14

Cheers

Terry

Hello,

Thank you for the help.  To help my issue, I have attached an Excel containing I/Q points.  There are about 45001 points captured.

Time interval between sampled point is 2.2222E-08seconds

Sample frequency = 2.03E+12 (45001/2.2222E-08).

 

How do I use FFT in Mathcad from the I/Q data stored in the file?

 Thank you.

 

Hello,

Thank you for the help.  To help my issue, I have attached an Excel containing I/Q points.  There are about 45001 points captured.

Time interval between sampled point is 2.2222E-08seconds

Sample frequency = 2.03E+12 (45001/2.2222E-08).

 

How do I use FFT in Mathcad from the I/Q data stored in the file?

 Thank you.

 

Maxplus12
6-Contributor
(To:Maxplus12)

So I need to take FFT and plot FFT vs magnitude


@Maxplus12 wrote:

Hello,

Thank you for the help.  To help my issue, I have attached an Excel containing I/Q points.  There are about 45001 points captured.

Time interval between sampled point is 2.2222E-08seconds

Sample frequency = 2.03E+12 (45001/2.2222E-08).

 

How do I use FFT in Mathcad from the I/Q data stored in the file?

 Thank you.

 


There are several choices:

  1. You can wait til Monday when I've got Mathcad again...
  2. You can hope someone else takes pity and is bored
  3. You can start with the example file I posted, strip off the front end where I created two arrays, put your data in, and adjust the parameters to suit:
  • In Mathcad 14 (or 15, they're almost identical) you can insert a data file.  This has the advantage of keeping the data in the file.  You can read an EXCEL file too if you'd rather.  Select and copy the data from EXCEL, right-click on the data table, and paste table.Do one for I and one for Q.
  • adjust the sampling frequency (fs) for your application. Your sampling frequency calculation is wrong!  Sampling frequency is merely the inverse of the time step.
  • You may need to adjust your sliding window size, or the shape of your windowing function (check the ebook "Signal Processing."

Good luck!

I can wait till Monday but also I'll make an attempt.

Regarding sampling freq, I divided interval time to no of captured pts (450001).

See this link.

https://www.google.co.uk/url?sa=t&source=web&rct=j&url=http://www.stem2.org/je/Excel_FFT_Instructions.pdf&ved=2ahUKEwj7vJu127rZAhXKDcAKHQqcCsUQFjAKegQICBAB&usg=AOvVaw24scHKqPRa_USkMnB6KubT
-MFra-
21-Topaz II
(To:Maxplus12)

Hi,

Since the data of the problem are insufficient, the results obtained are the following (see attached worksheet):

 

IQ4.jpgIQ5.jpg

 

Maxplus12
6-Contributor
(To:-MFra-)

I shall look into this. Much appreciated.

The signal should like a 4G LTE in 20MHz signal with QPSK.

There are about 45001 points captured. Can you please what do you mean by insufficient data?

What t's and sample interval was used?
-MFra-
21-Topaz II
(To:Maxplus12)

I used the information you gave me, I did not add anything else. The spectrum of the QPSK signal, as you can see from the drawing (zeros) for the low-frequency sample modulating signal, also depends on the digit frequency, which is not known to me. In the first graphs of the signals I and Q, if you reduce the interval, for example from 0 to 50, the graph becomes more significant. You have to consider the two signals as two random processes and apply the relative theorems .

IQ6.jpg

IQ7.jpg

I just started looking at your file for I and Q, the first one that had them together.  They don't look like I'd expect, I expected a fairly constant amplitude, but:

Capture3.PNG

Expanded:

Capture.PNG

If I superimpose a 20 MHz carrier (note: I and Q rescaled for viewing):

Capture2.PNG

Are you sure about what you have?

Hi Fred
Please use the IQ file which I posted last Thursday.
Hi MF
Thank you. I shall look into this evening

I looked briefly at your file, and at your sampling.

Capture.PNG

Hello
The captured time of IQ data was 1ms with 45001 points ie approx 45MHz sampling freq. The sampling time is 2.222E-08.

The signals bandwidth is 20MHz. As I measured using the signal analyser (IS window), I believe the IF freq is 20MHz.




@Maxplus12 wrote:
Hello
The captured time of IQ data was 1ms with 45001 points ie approx 45MHz sampling freq. The sampling time is 2.222E-08.

The signals bandwidth is 20MHz. As I measured using the signal analyser (IS window), I believe the IF freq is 20MHz.

If the entire sample is 2.222E-08, and the carrier frequency is 20 MHz, how many cycles should we see in the sampled data?

 

If the sampling frequency is 45 MHz and you have 45000 samples, how long should the record be?

Hi Fred,

... If the question is addressed to me, I'm sorry and I apologize, but I have other things to devote myself to, I have already given a lot of time to the problem of maxplus2. 
Greetings

Maxplus12
6-Contributor
(To:-MFra-)

Hello Fred,

This is how I interpret.

Sample Time is the time between samples (2.222E-08sec)

Number of samples is the number of data points (45001) in the captured signal (capture time =1ms).

Therefore sample time = 1E-03/45001= 2.222E-08seconds.

fs=1/ts = 1/2.222E-08 = approx. 45MHz. 

The signal BW's is 20MHz wide.  As MF said earlier, signal frequency is irrelevant for this case as we are analysing the captured I/Q data.

Hope this helps.


@Maxplus12 wrote:

Hello Fred,

This is how I interpret.

Sample Time is the time between samples (2.222E-08sec)

Number of samples is the number of data points (45001) in the captured signal (capture time =1ms).

Therefore sample time = 1E-03/45001= 2.222E-08seconds.

fs=1/ts = 1/2.222E-08 = approx. 45MHz. 

The signal BW's is 20MHz wide.  As MF said earlier, signal frequency is irrelevant for this case as we are analysing the captured I/Q data.

Hope this helps.


okay.  Your calculation of sample time is based on the assumption that the 45001 points span a millisecond.  If that's true then your sample time (my delta t) and sample frequency (fs) agree.

 

But you say that these two signals are supposed to be very narrow frequencies (20 MHz) that shift phase.  So we should expect the amplitude plot of the FFT of either I or Q should have a vary narrow single spike.  (If we got the sampling frequency wrong the spike won't be at 20 MHz, but there should only be one single frequency.  We all agree that the signals span 20 MHz (a 20 MHz bandwidth).  These are NOT QPSK signals. 

 

 

I believe we've been chasing different technology.  I typed "4G LTE QSPK" into Google and found a whole lot of info.  Check out tutorial on LTE data transmission

 

Quoting the article:

"LTE uses the popular orthogonal frequency division multiplex (OFDM) modulation scheme. It provides the essential spectral efficiency to achieve high data rates but also permits multiple users to share a common channel. OFDM divides a given channel into many narrower subcarriers. The spacing is such that the subcarriers are orthogonal, so they won’t interfere with one another despite the lack of guard bands between them. This comes about by having the subcarrier spacing equal to the reciprocal of symbol time. All subcarriers have a complete number of sine wave cycles that upon demodulation will sum to zero.

In LTE, the channel spacing is 15 kHz. The symbol period therefore is 1/15 kHz = 66.7 µs. The high-speed serial data to be transmitted is divided up into multiple slower streams, and each is used to modulate one of the subcarriers. For example, in a 5-MHz channel, up to 333 subcarriers could be used but the actual number is more like 300. A 20-MHz channel might use 1024 carriers. The modulation on each can be quadrature phase-shift keying (QPSK), 16-phase quadrature amplitude modulation (16QAM), or 64-state quadrature amplitude modulation (64QAM) depending on the speed needs."

I believe that is what I and Q are, each constitutes a combination of carriers which we would need to sort out to be able to demodulate.  The article shows what the FFT of this carrier signal looks like:

Capture.PNG

Look familiar?

Hi Fred
Regarding your yesterday's question.
The signal was created using Keysight Signal studio to generate LTE 20MHz wide signal.


@Maxplus12 wrote:
Hi Fred
Regarding your yesterday's question.
The signal was created using Keysight Signal studio to generate LTE 20MHz wide signal.



Thanks.

 

I believe that you have more than a single QSPK channel pair here.  (A quick search of Keysight's web page tells me that I'm way over my head here!)

 

From what I've read you need to build a (very selective) bandpass filter (15 KHz wide) to strip out each (of maybe 1024) channel pair.  Then you could demodulate that pair using QSPK. . .   and o it 1024 times!

 

Any way to "dumb down" Keysight to a single channel?

Hi Fred,

Indeed, knowing the signal frequency is irrelevant, if it is to be determined, from a sequence of samples, the spectrum thereof.  Moreover, from the spectrum thus obtained, I can extract some previously unknown data.

 

Top Tags