Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help with MATLAB code - Basics of communication engineering

Status
Not open for further replies.

userXY

Junior Member level 1
Joined
Feb 9, 2017
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
193
I need help with the following:

Write a program in MATLAB for plotting amplitude and phase spectre of a rectangular signal (see the first image) in the following cases:
1) A=1V,T=1s,θ=0.2s
2) A=1V,T=2s,θ=0.2s
3) A=1V,T=2s,θ=0.4s


**broken link removed**

Plot a power spectre.
What amount of power is situated by the first zero of envelope?
Describe the qualitative influence of period and duration of pulse on amplitude spectre.

Modify the program to obtain amplitude and phase spectre of triangular signal (see the second image).

**broken link removed**

Draw a power spectre.

Perform the comparative analysis of these signals considering the spectral efficiency.

1) I have the following code:
Code:
%Rectangular signal
A=1;T=1;tau=0.2;
alpha=tau/T;
num=fix(1/alpha); %number by the first zero of envelope
n=-3*num:3*num; %number of components for plotting 
Cn=A*alpha*(sinc(n*alpha));
subplot(2,1,1)
stem(n*2*pi/T,abs(Cn));
title('Amplitude spectre');
xlabel('Angular frequency[rad/s]');
ylabel('|Cn|');
grid

subplot(2,1,2)
y=sign(n);
p=angle(Cn+eps);
stem(n*2*pi/T,(y.*p),'r');
title('Phase spectre');
xlabel('Angular frequency[rad/s]');
grid

   k=-num:num;          % first spectre arcade
   Ck=A*alpha*(sinc(k*alpha));
    s=sum(abs(Ck).^2);   %power evaluated by Parselav's theorem
    eta=s/(A*A*alpha)   % coefficient of power efficiency of the first spectre arcade

% Triangular signal
figure
subplot(2,1,1);
Cn1=A*alpha*((sinc(n*alpha)).^2);
stem(n*2*pi/T,T*abs(Cn1),'linewidth',2);
title('Amplitude spectre');
xlabel('Angular frequency[rad/s]');
ylabel('|Cn|');
grid

subplot(2,1,2)
y=sign(n);
p=angle(Cn1+eps);
stem(n*2*pi/T,(y.*p),'r','linewidth',2);
title('Phase spectre');
xlabel('Angular frequency[rad/s]');
grid

 k1=-num:num;
    Ck1=A*alpha*((sinc(k1*alpha)).^2);
     s1=sum(Ck1.^2);    %power

Code graph results:

1) Rectangular spectre

**broken link removed**

2) Triangular spectre

**broken link removed**

Question 1: How to plot amplitude and phase spectar of rectangular signal in 3 cases:
1) A=1V,T=1s,θ=0.2s
2) A=1V,T=2s,θ=0.2s
3) A=1V,T=2s,θ=0.4s
?

Question 2: How to plot power spectre of rectangular signal?
Question 3: How to determine what amount of power is situated by the first zero of envelope (for rectangular signal)?
What amount of power is situated by the first zero of envelope (for rectangular signal)?
How to describe the qualitative influence of period and duration of pulse on amplitude spectre (for rectangular signal)?
Question 4: How to plot power spectre of triangular signal?
How to perform the comparative analysis of rectangular and triangular signal considering the spectral efficiency?

Note: This is not homework. I am practicing for exam.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top