Matlab ASK PSK FSK Code for Square and Sine Waves | Step-by-Step Guide

  • Context: MATLAB 
  • Thread starter Thread starter sara_UK
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary

Discussion Overview

The discussion revolves around writing a Matlab code for Amplitude Shift Keying (ASK) using square and sine waves. Participants are addressing issues related to generating the final figure in the code provided.

Discussion Character

  • Technical explanation, Debate/contested, Homework-related

Main Points Raised

  • One participant shares their Matlab code for generating a square wave and a cosine wave, but reports that the final figure for ASK is not displayed correctly.
  • Another participant suggests that the calculation of ASK is incorrect, implying that this is the reason for the missing plot.
  • A third participant asks for clarification on which specific calculation is being referred to and requests suggestions for correcting the issue.
  • A fourth participant provides a link to a blog as a potential resource for obtaining the correct code.

Areas of Agreement / Disagreement

There is no consensus on the specific calculation error in the ASK implementation, and multiple viewpoints regarding the solution are present.

Contextual Notes

The discussion does not clarify the assumptions behind the calculations or the definitions of the signals being used, leaving some steps unresolved.

Who May Find This Useful

Individuals interested in signal processing, Matlab programming, or those seeking assistance with ASK modulation techniques may find this discussion relevant.

sara_UK
Messages
4
Reaction score
0
Hello guys..

I am trying to write a code for ASK in Matlab, but it doesn't give me the final figure!

% Generating a input square wave
x1 = 0:(pi/100):(10*pi);
y1 = square(x1);
A = plot(x1,y1);
figure(1),A,title( 'Square wave');xlabel('x'); ylabel('y');ylim([0,1]);grid;

% Generating a carrier(cosine wave) with a higher frequency as compared to sq.wave
f=0.8
t = 0:(pi/100):(10*pi);
y2 = cos(2*pi*f*t);
figure(2),B = plot(t,y2),title( 'Sine wave');xlabel('x'); ylabel('y');ylim([-2,2]); xlim([0,35]);grid;

ASK = A.^B;
figure(3),plot(t,ASK),title('ASK');xlabel('x'); ylabel('y');ylim([-2,2]); xlim([0,35]);grid;

your helpd would be very much appriciated .

Thanks
 
Physics news on Phys.org
Your calculation of ASK is not correct and so you are not getting the plot. Please check.
 
Which calculation do u mean? and how do u suggest me correcting it?
 
you can fallow this blog to get code
kemppro.blogspot.in
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K