I want to draw the output from a QPSK modulator in simulink
but scope block couldn't do that and a message say that the signal is complex and so scope couldn't draw it.
How can I plot such signal and what a block could be used to get the output from QPSK modulator.
thanks
You need to separate it into real and imaginary parts using the Complex to Real-Imag block and then you can plot those signals on a scope. If you want them on the same scope, you can either change the scope parameters to have 2 inputs (similar to subplot in MATLAB) or multiplex the two signals together with a Mux block (to have two traces on the same set of axes).
I think it is better to put a raised cosine transmit filter after the QPSK modulator then plot the output using timescope
Related
I build an equivalent circuit in Simulink and it works. Now I want to get the nquvist plot of this equivalent circuit. Does anyone have an idea how to achieve this. Till now I only get the Impedance versus the frequency. I attached the equivalent circuit:
Thanks a lot
When using blocks from "Simscape Power Systems Specialized Technology" use voltage/current measurement blocks (depending on the numerator/denumerator of the transfer function). The outputs of these blocks are Simulink signals. Once you have the signals, you can use the "Simulink Control Design" toolbox to display a Nyquist plot directly. See following link for an example (although for Bode plot, but it is straight forward to apply the procedure to Nyquist plots).
I've been trying to use Simulink for modelling an oscilloscope (including DSP). I am still very novice so please forgive me if the following question is way too easy: How do I implement AC coupling (remove DC component) in Simulink while using analog signals? I know there is a DC blocker, but it only accepts discrete signals and I want to discretize my signal later with an imperfect ADC.
I'm trying to use a MATLAB function for the AC coupling, but I cannot find a way to use the existing analog signal gained from the function declaration. Instead, all MATLAB documentary seems to want me to use an analog device on my computer (https://mathworks.com/help/daq/analog-data-acquisition.html).
Thank you for any efforts and/or suggestions! :)
I don't think using the Matlab Function Block will work since you need to hold a state. To simulate AC coupling, I believe that you need to create a high pass filter. This removes DC from the signal so that the waveform is centered around zero. The corner frequency generally needs to be very low so that there is no distortion of the waveform being measured. You can build this without any special toolboxes. You just need an integrator block, gain block and some summation blocks.
An example is provided below:
This example applies a DC step to the waveform at 1 second. The figure below provides the output
In the upper figure (input) the offset remains, but in the lower figure (output) the offset is removed.
If you want using the matlab AC Coupling function, try using the Matlab Function Block : https://fr.mathworks.com/help/simulink/ug/creating-an-example-model-that-uses-a-matlab-function-block.html . You can use it like any matlab function, i.e. function [out1, out2] = my_function(in1) but it will be defined in a simulink block.
I tried using the 'Spectrum Analyzer' and those signal blocks (sine, pulse generator, triangle generator and sawtooth generator) separately of course, but the spectrum block needs a discrete signal or a non-infinite signal, and there's only a discrete sine block, is there a way to generate the others?
Most input blocks, including those you list, have a Sample Time parameter. Make it a number greater than 0 to specify a discrete sample time. For instance 0.001 would give you a milli-second sample rate.
For the few blocks that don't have this, simply use a Zero-Order Hold on the output of the block, and specify a sample time for the ZOH block.
I want to plot gmsk modulator "signal wave form" in simulink. but because gmsk modulator output is complex array, scope can't show it directly, and when I use complex to real / image converter, it's wave form is clearly just flat lines "fig1" rather than "fig2".so i should convert them to sin and cos with their respectively phase and amplitude but don't know how to do it yet. i want to plot something like this "fig2"
thank you.simulink project
When using blocks from the DSP Blockset or the Communications Blockset you'd usually also use the specialized viewers available with those blocksets to view signals. In this case you most likely want the Spectrum Analyzer.
To get familiar with various ways of viewing this type of signal have a look at some of the examples. For instance,
>> commadjcochanint
I should stimulate how the lowpass filter work exactly with simulink so i create a signal generator f=50 hz and i make a lowerfilter and after that i want to see it so the only tool that i found it is spectrum analyzer but when i simulate i get two errors
Sorry if it's not really explain because i'm beginner in simulink
The signals being fed into the Spectrum Scope blocks need to be discrete-time signals instead of continuous-time. You can accomplish this by adding a Zero-Order Hold block before each Spectrum Scope, setting the desired discrete sample time in the Zero-Order Hold block's dialog parameters.
As a heads up, you're probably going to want to buffer your signals as well (the spectrum is calculated on "frames" of data, which you can read about here: Create Frame-Based Signals). To do this, you can either use a Buffer block in between your Zero-Order Hold and Spectrum Scope, or select "Buffer Input" in the Spectrum Scope dialog parameters.