Forums › BB Series Discussions › Pull IQ Samples To Make Constellation Plot (API)
- This topic has 6 replies, 3 voices, and was last updated 5 years ago by
Anonymous.
- AuthorPosts
stevecrmParticipantI’m trying to pull out raw IQ samples to create a constellation plot using the API. When I use spike I get a nice QPSK signal constellation, but I’m having trouble getting anything similar with the API.
I’m using the example that comes with the SDK, all I’ve done is change some frequency/bandwidth values.
My carrier is 1.84MHz wide at 70MHz. The documentation says that IQ samples are interleaved and range from +/-1. I’m assuming this means that the resulting array is structured like:
I1, Q1, I2, Q2, I3, Q3…etcMy problem is that I’m getting IQ values that range from +/- 0.01, so I think I’m just seeing noise. If I plot I and Q separately they seem like roughly ok sine waves. Also if I plot IQ in 2D to make a constellation, I just get a big circular donut, nothing that looks like there are 4 converging points.
I use the reference level of -40 because that worked in Spike.
Anyone know what I’m missing? Any helps is appreciated
I’ve adjusted the demo code to take the samples and dump them to a file:
int id = -1; bbStatus status = bbStatus.bbNoError; txtResults.Text += "Opening Device, Please Wait\n"; status = bb_api.bbOpenDevice(ref id); if (status != bbStatus.bbNoError) { txtResults.Text += "Error: Unable to open BB60\n"; txtResults.Text += bb_api.bbGetStatusString(status) + "\n"; return; } else { txtResults.Text += "Device Found\n\n"; } Console.Write("Configuring the device to stream I/Q data\n"); bb_api.bbConfigureCenterSpan(id, 70000000, 4.0e6); //center hz, span hz bb_api.bbConfigureLevel(id, -40.0, bb_api.BB_AUTO_ATTEN); bb_api.bbConfigureGain(id, bb_api.BB_AUTO_GAIN); bb_api.bbConfigureIQ(id, bb_api.BB_MIN_DECIMATION, 4.0e6); //bandwidth hz status = bb_api.bbInitiate(id, bb_api.BB_STREAMING, bb_api.BB_STREAM_IQ); if (status != bbStatus.bbNoError) { txtResults.Text += "Error: Unable to initialize BB60 for streaming\n"; txtResults.Text += bb_api.bbGetStatusString(status) + "\n"; return; } int return_len = 0; int samples_per_sec = 0; double bandwidth = 0.0; bb_api.bbQueryStreamInfo(id, ref return_len, ref bandwidth, ref samples_per_sec); txtResults.Text += "Initialized Stream for \n"; txtResults.Text += "Samples per second: " + (samples_per_sec / 1.0e6).ToString() + " MS/s\n"; txtResults.Text += "Bandwidth: " + (bandwidth / 1.0e6).ToString() + " MHz\n"; txtResults.Text += "Samples per function call: " + return_len.ToString() + "\n"; // Alternating I/Q samples // return_len is the number of I/Q pairs, so.. allocate twice as many floats float[] iq_samples = new float[return_len * 2]; int[] triggers = new int[80]; bb_api.bbFetchRaw(id, iq_samples, triggers); txtResults.Text += "Retrieved one I/Q packet\n\n"; StringBuilder sb = new StringBuilder(); foreach(float sample in iq_samples) { sb.Append(sample.ToString() + Environment.NewLine); } File.WriteAllText("output.csv", sb.ToString()); txtResults.Text += "Closing Device\n"; bb_api.bbCloseDevice(id);
stevecrmParticipantI’ve attached a picture of the data I got from my capture
Attachments:
You must be logged in to view attached files.
AndrewModeratorHi stevecrm,
So you may indeed be pulling the I/Q data and plotting it correctly, but unfortunately it will still not produce the constellation plot you see in Spike. The reason for this is that Spike is doing additional processing between acquiring I/Q data from the API and plotting it in the constellation plot.
The main steps the Spike software is performing is resampling, symbol timing recovery, carrier recovery, and filtering. This can be quite a complex subject and not one I can cover in a forum post. You can find more information in a digital communications textbook, by searching online for search terms like “PSK demodulation”, or exploring software packages like GNURadio which has software blocks for the major components of a PSK receiver.
Keysight has an excellent block diagram of the various components in a spectrum analyzer when making PSK modulation measurements. See the following link on page 282.
http://literature.cdn.keysight.com/litweb/pdf/E4440-90620.pdf
I hope this helps, let me know if you have follow up questions.
Regards
stevecrmParticipantThanks for the quick response!
I realize there’s a lot more than just plotting the samples, first of all my signal is 1.86Msym/s and I pulled points at 40, so there’s some intense re sampling needed.
Before going through with the rest of the work I was concerned about how low my samples were compared to the stated range.
Either way it’s going to be fun to try! It’s one of those things I had a textbook knowledge of, going to be fun actually try coding it!
Thanks for the link!!
stevecrmParticipantWhen I pull IQ samples are they already shifted down to baseband? For instance when I sample my 70MHz signal at 40Msamp/s I believe I should have 27MHz of instantaneous bandwidth. Has that 27MHz around 70MHz been shifted to 27MHz around 0Hz?
AndrewModeratorHi Steve,
Yes, the center frequency you select in the bbConfigureCenterSpan is the 0Hz/baseband frequency of the IQ samples and your IF bandwidth (27MHz) is centered around this frequency.
Regards,
Andrew
AnonymousInactiveHello, have you solved the problem of drawing constellation diagrams with I / Q data?
- AuthorPosts
You must be logged in to reply to this topic.