Trouble Plotting an eye diagram of an analog signal.

6 views (last 30 days)
Hi, i'm having trouble plotting a clean eyediagram like how they've done it in the example on this page: :https://www.mathworks.com/help/comm/ref/eyediagram.html#d126e43569.
They are specifying digital values as the "signal" and then using a modulation scheme and applying filter(s) to get it into the form specified.
Suppose I have an analog signal vector defined as a vector of decimal values ie; -0.25, -1.34, 3.45. -1.6 etc; and this is my data how can I plot a clean eye diagram with these decimal values in the signal.
I've tried the following code:
eyediagram(decimalvaluedsignal, numsamples);
It might help that the decimal-valued signal i'm providing is a chirp frequency signal.

Answers (1)

Hassaan
Hassaan on 12 Jan 2024
  1. Symbol Rate: You need to know the symbol rate of the digital signal that your analog signal represents. The symbol rate will tell you how many samples per symbol (numsamples) there are in your signal.
  2. Alignment: The starting point for the eye diagram needs to be aligned with the symbol boundaries. If the starting point of your eyediagram function call is not aligned with a symbol boundary, the eye diagram will not be clean.
  3. Chirp Signal: If your signal is a chirp, it may continuously vary in frequency. An eye diagram is typically used for signals with a constant symbol rate. If the chirp signal represents a frequency-modulated version of the baseband signal, you may need to demodulate it back to baseband before generating the eye diagram.
Assuming you have a baseband signal and know the number of samples per symbol, you can use the eyediagram function:
% Check if the Communications System Toolbox is available
if ~license('test', 'Communication_Toolbox')
error('Communications System Toolbox is not available.');
end
% Define an analog signal vector with dummy data
% This should be replaced with your actual analog signal data
analogSignal = [-0.25, -1.34, 3.45, -1.6, 0.5, -0.75, 2.3, -1.8, 1.0, -0.5];
% The number of samples per symbol
% This needs to be set according to the symbol rate of your actual signal
numsamples = 2; % Example: 2 samples per symbol
% Call the eyediagram function to plot the eye diagram
eyediagram(analogSignal, numsamples);
% If you have a longer signal or actual data, you can plot it directly
% eyediagram(actualAnalogSignal, actualNumSamples);
To get a "clean" eye diagram, the following conditions must be met:
  • The signal must be properly sampled, i.e., numsamples should be correct.
  • The signal should not be distorted or have too much noise.
  • The starting point of the eyediagram function call should align with symbol boundaries.
If you have a chirp signal, you might be looking at a frequency-modulated signal, and an eye diagram might not be the correct tool to visualize what you're looking for. Instead, you might want to look at a spectrogram or some other frequency domain representation. If the chirp is a representation of frequency hopping in a digital signal, you would need to process it to recover the baseband symbols before attempting to create an eye diagram.
Remember that the eye diagram is a tool typically used for digital signals to visualize the effects of intersymbol interference and timing errors. If your signal is analog and does not represent a sampled digital signal, the concept of an eye diagram may not apply as you expect.
---------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems | Firmware Developement | Simulations
  • Electrical and Electronics Engineering
Feel free to contact me.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!