Code Monkey home page Code Monkey logo

signals-and-systems's Introduction

% #Signals-and-Systems %Design of Signals and Systems code for first year university students. The code is done in matlab. % % %Problem 1A %Let us plot a discrete time sinusoid 𝑥[n] = sin[Ωo * n]. % Ωo = - pi/4. %First we have to define the independent variable axis [n] in our script: % Ωo is Omega0 in our script clear all; close all; clc;

%1a

n = 0:10; % This creates an array of 11 digits from 0 to 10. % These variables will form the independent axis

Omega0 = -pi/4; %For the value of x[n], we must find the value of omega as given in the %question

xn = sin (Omega0 *n);

%After representing omega, we can now calculate the value of the amplitude %of each value on the dependent axis using what we have obtained from the %independent axis.

figure; %This brings out an empty figure sheet for diagrams.

stem (n, xn) %stem(X,Y) plots the data sequence Y at the values specified in X %Discrete sequence or "stem" plot. stem(Y) plots the data sequence Y as stems from the x axis terminated with circles for the data value.

set(gca,'FontName','times','FontSize',16); plot(t, xn_ct,'k--', 'LineWidth', 3); stem(n, xn, 'b', 'LineWidth', 4); xlabel('Time \itn'); ylabel('\itx\rm[\itn\rm] = sin(\Omega_{0}\itn\rm)'); title('Task 1, Part (a) with discrete and continuous n, \Omega_{0} = - \pi/4') grid on;

xlabel('Time \itn'); %labels the x axis ylabel('\itx\rm[\itn\rm] = sin(\Omega_{0}\itn\rm)'); %labels the y axis title('Task 1, Part (a), \Omega_{0} = -\pi/4'); %Titles the graph

%The command \it makes the text that follows it %italics and \rm returns the text to normal.

%PLOTTING THE CONTIONUS TIME SIGNAL

t = 0:0.01:10; %Creates an array ot t from 0 to 10 with an interval of 0.01 xn_ct = sin(Omega0 *t) %For a value of t, a contionous value of xn was created.

figure; hold on;

%hold ON holds the current plot and all axis properties, including %the current color and linestyle, so that subsequent graphing commands %add to the existing graph without resetting the color and linestyle.

% % % % % %

signals-and-systems's People

Contributors

sydneyanuyah avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.