matlab simulink waveform draw - matlab

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

Related

Drawing Nquvist-Plot i Simulink

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).

Generating a sine wave in Simulink without any standard blocks

I'm trying to generate a sine wave without using any standard blocks available in Simulink. Right now I'm using constants for phase angle and frequency but eventually I want to vary this and hence not using the standard blocks. Here is the Simulink model
Here is the scope output
The output is not a sinusoidal wave. What am I screwing up here?
I'm using a fixed step auto solver.
As I'm currently not in the possession of Matlab/Simulink so I can't construct a working example. But I think the best solution for your problem is using a Simulink function block. In this block you can define a Matlab function of your own design and it will allow you to generate any signal you want.
Mathworks example

Generating square wave using Matlab embeded function

I intend to generate a square wave which is applied on a DSP.
I have written these codes and put them in an embeded Matlab function.
function y = fcn(u)
%#eml
t=0:0.001:1
h = sign(sin(125600*t+u));
y= (h+1)/2
where, u is a constant value of 0.582 which is used for shifting the square wave.
The problem is at the output in the simulation, instead of getting a square wave, I see only two straight lines of y=o and y=1.
Please let me know where is the problem that I can not get the square wave?
Note that the frequency of square wave must be 20 kHz. Therefore, I adjust the sampling time as 1e-7 s. And also its amplitude is between 0 and 1 In addition, due to this signal must be transferred to a DSP board, in the "solver option" I chose the type: " Fixed-step" and for the Solver: "Discrete (no continues state)".
Thanks a lot.
This is wrong on many levels.
First of all, you never define the time vector inside a MATLAB Function, that's what the Simulink engine does. Pass time as an input to your MATLAB Function block and use a Clock block to generate the time input.
Second, the above is fine for simulation, but it sounds like you are generating C code from the Simulink model to run it (in real-time) on your DSP. This is not my area of expertise, but from memory, I think you need to enable "absolute time" or something similar for the above to work with code generation. However, I think this is target-dependent and so I'm not sure whether this will work on your DSP.
In you function type plot(t,y) at the end. You are generating a 20khz square wave (assuming you are sampling at 1e-7). Essentially your generating it is working.
Now, what is the DSP board you are using/any information that is relevant to your problem?
I don't know what you are referring to when you say "Solver" either.
Is the "simulation" an oscilloscope or a program? Either way perhaps it is not triggering correctly? Is there an edge trigger option?

signal generation model in Simulink from matlab

How do I generate following signal in simulink:
t=(0:1000)/1000*10*pi;
I want to build the model of the following matlab code:
t=(0:1000)/1000*10*pi;
x = (t).*sin(t);
y = (t).*cos(t);
z = t;
This is fairly basic stuff. Have you gone through any Simulink tutorial, introduction videos/webinars or even the getting started guide of the documentation?
Here are a few suggestions to help you answer your question:
Set the stop time of your model to 1000s and use a fixed-step solver with a step time of 1s.
Use a Clock block with a decimation of 1. That's your 0:1000 vector.
Feed the output of your Clock block to a Gain block, with the gain set to 1/(10000*pi). That's your t vector.
Feed your t signal to two Trigonometric Function blocks, one set to sin and one set to cos. That will generate two signals, sin(t) and cos(t).
Now multiply your t signal with your sin(t) signal using a Product block, to generate your x signal (t*sin(t)).
Do the same thing with t and cos(t) to generate your y signal. z is already done since it's equal to t.
EDIT following comments
The answer to your comment is really basic Simulink stuff. You should learn how to use Simulink before trying to do advance stuff like VR in Simulink. It's a bit like trying to run before you can walk.
Here are a few resources that may be useful:
Simulink Videos and Examples
Simulink Webinars
Simulink tutorial
Getting Started with Simulink in the Simulink Documentation
I don't know much about VRML, but be aware that the coordinate system in VRML is different from that in MATLAB/Simulink (see http://www.mathworks.co.uk/help/sl3d/vrml.html). You should also have a look at Virtual World Connection to a Model in the Simulink 3D Animation documentation.

how to stimulate a lowerpass filter in simulink?

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.