{"id":228325,"date":"2025-06-07T08:05:35","date_gmt":"2025-06-07T08:05:35","guid":{"rendered":"https:\/\/learnexams.com\/blog\/?p=228325"},"modified":"2025-06-07T08:05:37","modified_gmt":"2025-06-07T08:05:37","slug":"plot-the-following-continuous-time-signals-over-the-range-t-77-using-1000-sample-points-per-unit-time","status":"publish","type":"post","link":"https:\/\/www.learnexams.com\/blog\/2025\/06\/07\/plot-the-following-continuous-time-signals-over-the-range-t-77-using-1000-sample-points-per-unit-time\/","title":{"rendered":"Plot the following continuous time signals over the range t [-7,7] using 1,000 sample points per unit time."},"content":{"rendered":"\n<p> Plot the following continuous time signals over the range t [-7,7] using 1,000 sample points per unit time. ax1t=e-1cos2tt bxt=R{ei2x+\/7+r\/4} cx3t=-2x1t+1 ax4=ut+2-ut+2ut-2 2. Plot the following three discrete-time signals (using the stem command) over the range n E [-6,6]: ax1[n=cosn\/2+\/3 (bx2[n]= ()u[-n-1] cx3[n]=2&#215;2[-2n] (dx4[n]=x2[n]x1[n]for this part,consider x[n]and x1[n] as zero outside nE[6,6] Instructions for your plots: 1. Plot the continuous time signals on 4 different axes (4 separate figures) 2. Plot the discrete-time signals on 4 different axes within the same figure using the subplot command. 3. Use the grid command for each set of axes,and use xlabel and ylabel to label each set of axes.Also use title for each set of axes,e.g.,title&#8217;1a)&#8217; Turn in 4 continuous-time figures on 4 separate pages and one page containing the 4 subplots for the discrete-time signals. Also turn in your Matlab script.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-ast-global-color-1-color\">The Correct Answer and Explanation is:<\/mark><\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 MATLAB Script<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">matlabCopyEdit<code>%% Continuous-Time Signals\nt = -7:1\/1000:7; % 1000 sample points per unit time\n\n% a) x1(t) = e^(-t) * cos(2t)\nx1 = exp(-t) .* cos(2*t);\nfigure;\nplot(t, x1); grid on;\nxlabel('t'); ylabel('x1(t)');\ntitle('1a) x1(t) = e^{-t} cos(2t)');\n\n% b) x2(t) = Real{e^(i(2t + pi\/7 + pi\/4))}\nx2 = real(exp(1i*(2*t + pi\/7 + pi\/4)));\nfigure;\nplot(t, x2); grid on;\nxlabel('t'); ylabel('x2(t)');\ntitle('1b) x2(t) = Re{e^{i(2t + \u03c0\/7 + \u03c0\/4)}}');\n\n% c) x3(t) = -2 * x1(t + 1)\nx3 = -2 * exp(-(t + 1)) .* cos(2*(t + 1));\nfigure;\nplot(t, x3); grid on;\nxlabel('t'); ylabel('x3(t)');\ntitle('1c) x3(t) = -2 * x1(t + 1)');\n\n% d) x4(t) = u(t + 2) - u(t) + 2u(t - 2)\nu = @(t) double(t &gt;= 0);\nx4 = u(t + 2) - u(t) + 2*u(t - 2);\nfigure;\nplot(t, x4); grid on;\nxlabel('t'); ylabel('x4(t)');\ntitle('1d) x4(t) = u(t + 2) - u(t) + 2u(t - 2)');\n\n%% Discrete-Time Signals\nn = -6:6;\n\n% a) x1[n] = cos(n\/2 + pi\/3)\nx1n = cos(n\/2 + pi\/3);\n\n% b) x2[n] = n * u[-n - 1]\nx2n = n .* (n &lt;= -1);\n\n% c) x3[n] = 2 * x2[-2n]\nx2_neg2n = interp1(n, x2n, -2*n, 'linear', 0); % zero-padding\nx3n = 2 * x2_neg2n;\n\n% d) x4[n] = x2[n] * x1[n], zero outside n in [-6,6]\nx4n = x2n .* x1n;\n\n% Plot all discrete signals in one figure with subplots\nfigure;\nsubplot(2,2,1); stem(n, x1n); grid on;\nxlabel('n'); ylabel('x1[n]');\ntitle('2a) x1[n] = cos(n\/2 + \u03c0\/3)');\n\nsubplot(2,2,2); stem(n, x2n); grid on;\nxlabel('n'); ylabel('x2[n]');\ntitle('2b) x2[n] = n * u[-n - 1]');\n\nsubplot(2,2,3); stem(n, x3n); grid on;\nxlabel('n'); ylabel('x3[n]');\ntitle('2c) x3[n] = 2 * x2[-2n]');\n\nsubplot(2,2,4); stem(n, x4n); grid on;\nxlabel('n'); ylabel('x4[n]');\ntitle('2d) x4[n] = x2[n] * x1[n]');\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcd8 Explanation <\/h3>\n\n\n\n<p>This MATLAB project involves plotting both <strong>continuous-time<\/strong> and <strong>discrete-time<\/strong> signals using MATLAB\u2019s <code>plot<\/code> and <code>stem<\/code> commands, respectively.<\/p>\n\n\n\n<p>In the <strong>continuous-time section<\/strong>, we use a high-resolution time vector <code>t<\/code> with 1000 samples per unit time over the range <code>[-7,7]<\/code>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>(1a)<\/strong> plots a decaying cosine function <code>x1(t) = e^{-t}cos(2t)<\/code>; it shows damped oscillations due to the exponential decay.<\/li>\n\n\n\n<li><strong>(1b)<\/strong> calculates the real part of a complex exponential. Since <code>e^{i\u03b8}<\/code> is a complex sinusoid, the real part is just <code>cos(\u03b8)<\/code>, making the signal another cosine wave with phase shift.<\/li>\n\n\n\n<li><strong>(1c)<\/strong> applies a time shift and scaling to the original <code>x1(t)<\/code>, plotting <code>x3(t) = -2 * x1(t + 1)<\/code>, which flips and delays the waveform.<\/li>\n\n\n\n<li><strong>(1d)<\/strong> uses unit step functions <code>u(t)<\/code> to construct a piecewise signal: <code>x4(t) = u(t + 2) - u(t) + 2u(t - 2)<\/code>, resulting in discontinuous jumps at the defined points.<\/li>\n<\/ul>\n\n\n\n<p>For the <strong>discrete-time section<\/strong>, the vector <code>n = -6:6<\/code> defines our index range.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>(2a)<\/strong> defines a cosine-based signal <code>x1[n] = cos(n\/2 + \u03c0\/3)<\/code> and is periodic.<\/li>\n\n\n\n<li><strong>(2b)<\/strong> uses a shifted unit step to activate values for <code>n &lt;= -1<\/code>, giving a ramp for negative indices.<\/li>\n\n\n\n<li><strong>(2c)<\/strong> scales and reflects <code>x2[n]<\/code> to create <code>x3[n] = 2 * x2[-2n]<\/code>.<\/li>\n\n\n\n<li><strong>(2d)<\/strong> multiplies <code>x1[n]<\/code> and <code>x2[n]<\/code> elementwise to form <code>x4[n]<\/code>, which is defined only within <code>[-6,6]<\/code>.<\/li>\n<\/ul>\n\n\n\n<p>All figures include labels, grid lines, and titles for clarity. Separate figures are used for continuous-time plots, while discrete signals are arranged using <code>subplot<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/learnexams.com\/blog\/wp-content\/uploads\/2025\/06\/learnexams-banner6-101.jpeg\" alt=\"\" class=\"wp-image-228326\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Plot the following continuous time signals over the range t [-7,7] using 1,000 sample points per unit time. ax1t=e-1cos2tt bxt=R{ei2x+\/7+r\/4} cx3t=-2x1t+1 ax4=ut+2-ut+2ut-2 2. Plot the following three discrete-time signals (using the stem command) over the range n E [-6,6]: ax1[n=cosn\/2+\/3 (bx2[n]= ()u[-n-1] cx3[n]=2&#215;2[-2n] (dx4[n]=x2[n]x1[n]for this part,consider x[n]and x1[n] as zero outside nE[6,6] Instructions for your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25],"tags":[],"class_list":["post-228325","post","type-post","status-publish","format-standard","hentry","category-exams-certification"],"_links":{"self":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/228325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/comments?post=228325"}],"version-history":[{"count":0,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/228325\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/media?parent=228325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/categories?post=228325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/tags?post=228325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}