Complex Phase Difference
Phase difference between two complex signals
Libraries:
Communications Toolbox /
Utility Blocks
Description
The Complex Phase Difference block computes the phase difference in radians between the second input signal and the first input signal. The elements of the output are between π and π. This block independently processes each pair of corresponding elements.
Examples
Calculate Complex Phase Difference Between QPSK Modulated Signals
The model generates random integers and applies QPSK modulation. The first QPSK modulator has a phase offset of 0, while the second has a pi/4 phase offset.
The Complex Phase Difference block determines the phase difference. The data is passed to the workspace by using the To Workspace (Simulink) block.
Run the model and display the calculated phase difference.
The calculated phase difference is: 0.7854
The phase difference from the second input to the first input is equal to pi/4 as expected.
Apply Complex Phase Shift to QPSK Signal
The model applies QPSK modulation, and then applies a phase shift to a signal. Calculate the phase difference and plot the constellation of the signal before and after the phase shift.
The Complex Phase Shift block applies a 30 degree phase shift to a QPSK modulated signal. The Complex Phase Difference block determines the phase difference. A To Workspace (Simulink) block passes the calculated phase difference to the workspace. A Constellation Diagram block plots the signal constellation before and after the phase shift.
The phase difference is calculated from the second input to the first input.
The calculated phase difference is: 30.0000
Ports
Input
In1 — First input signal
scalar  column vector  matrix
First input signal, specified as a scalar, column vector, or matrix. If both input signals are nonscalar, they must be the same dimension.
Note
This block processes complex signals. Real values at the input
ports are type cast to complex values with
+j0
complex components.
Data Types: double
 single
Complex Number Support: Yes
In2 — Second input signal
scalar  column vector  matrix
Second input signal, specified as a scalar, column vector, or matrix. If both input signals are nonscalar, they must be the same dimension. In2 must be the same data type as In1.
Note
This block processes complex signals. Real values at the input
ports are type cast to complex values with
+j0
complex components.
Data Types: double
 single
Output
Out1 — Phase shift difference
scalar  column vector  matrix
Phase shift difference in radians, returned as a scalar, column vector, or matrix. If either input signal is nonscalar, the output signal dimension matches the dimension of the nonscalar input signal. The output is the phase difference between the second input signal and the first input signal. The elements of the output signal are between π and π and are the same data type as the input signals.
Block Characteristics
Data Types 

Multidimensional Signals 

VariableSize Signals 

Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced before R2006a
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
 América Latina (Español)
 Canada (English)
 United States (English)
Europe
 Belgium (English)
 Denmark (English)
 Deutschland (Deutsch)
 España (Español)
 Finland (English)
 France (Français)
 Ireland (English)
 Italia (Italiano)
 Luxembourg (English)
 Netherlands (English)
 Norway (English)
 Österreich (Deutsch)
 Portugal (English)
 Sweden (English)
 Switzerland
 United Kingdom (English)