MATLAB CODE
clc
clear all;
n=0:1:1000; %Time vector of 1 sec
x=3*cos(pi*n./3)+5*cos(n*pi./4)+cos(n*pi./5);
Fs=250000;% Sampling frequency
nfft=1024; % length of fft
X=fft(x,nfft); %fft calculation
X=X(1:nfft/2);
mx=abs(X); % magnitude response
f=(0:nfft/2-1)*Fs/nfft; % frequency vector
figure(1)
stem(x); %signal plot
xlim([0 1000]); % X axis limit
title('Given Signal')
xlabel('n')
ylabel('Amplitude')
figure(2)
plot(f,mx,'r')
title('Spectrum of sine wave')
xlabel('Frequency')
ylabel('Amplitude')
PLOTS


consider the signal using matlab Problem 2: Consider a signal: x[n] 3cos(n7/3) + 2sin(nt/4)+ cos(n7/5) Using...
5. Consider the signal x (t) = cos (2n . 500) + cos (2n . 1 500). Its spectrum X1c" consists of a pair of spectral lines at positive and negative frequencies. Use the MATLAB command fft to find and plot the signal's spectrum using various values of N.
I need Matlab code
Message Carler cos (20.000rt) modulation index: 0,2 signal: 2 cos (2001tt) signal : - Modulate and demodulate these 2 signals and plot time domain and frequency spectrum for all steps Write whole code clearly. Use Matlab.
Write a MATLAB code for the question below.
There is an initial signal containing 60 Hz sinusoid of amplitude 0.8 and a 150 Hz sinusoid of amplitude 1.2 corrupted by a noise - using the randn command - (zero-mean white noise with variance of 4). Plot the noisy signal in the time domain. After that compute the Fourier transform -using the fft command of the noisy signal, compute the two-sided spectrum. Define the frequency domain f and plot the single-sided...
USING MATLAB
please show all commands
(sin x + cos x)^2 = 1 + 2sin xcos x (b) 1 - 2cos x - 3cos^2 x/sin^2 x = 1 - 3cos x/1 - cos x For each part, verify that the identity is correct by calculating the values of the left and right sides of the equation, substituting x=20 degree.
Amplitude=3; fs=8000; n=0:399; t=0:1/fs: n*1/fs-1/fs; signal=3+3*cos(2*pi*1100*t)+3*cos(2*pi*2200*t)+3*cos(2*pi*3300*t); fftSignal= fft(signal); fftSignal=f ftshift (fftSignal); f=fs/2*linspace(-1,1,fs); plot(f,abs(fftsignal); xlabel('Frequency(Hz)’) ylabel('amplitude(v)') title('Spectral domain') plz code above using For ..End loop to archive the same results.
Need MatLab code
Exercise: Use MATLAB to generate the sinusoidal waveform: x(t) = 3 cos(1200) Consider the frequency of this sinusoid and use this information to select an appropriate time-step and time array that will allow this signal to be correctly represented and displayed on a new MATLAB figure window (display 4 periods of this wave only). Now set up an appropriate frequency array and use the fft() and fftshift() functions to generate and plot the Fourier Transform (magnitude spectra)...
Q: please solve using matlab code withe comment 1. Write the Matlab code to generate: x = cos(w1*t) + cos(w2*t); where, w1=7; w2=23; t = [0:0.005:2] 2. Plot the signal using sub plot a. in time domain b. in frequency domain 3) Sample the signal under different sampling conditions: a. Ts<1/2fm b. Ts=1/2fm c. Ts>1/2fm 4). Multiple plot: the signal sampled under sampling condition and the signal x a. in time domain b. in frequency domain c. Label and Title...
Please answer in MATLAB, thank you!
2. Calculate the energy of time domain signal x (t) and z (t) for the range of 0SIS2.5 Also calculate the energy of these signals in frequency domain using Parseval's theorem. Plot Energy (X) and Energy (Z) as a function of frequency f in a 2xl subplot (Energy vs frequency plot is know as energy spectrum of a signal).
2. Calculate the energy of time domain signal x (t) and z (t) for the...
Problem 2: A periodic signalxit) is shown below A =10, T-4 sec. -T Write a MATLAB script to plot the signal, using enough points to get a smooth curve. Compute the Fourier series coefficients for the signal (if you can find them in the text, that is ok). Plot the single-sided or double-sided spectra for each signal. Include enough frequencies in the plots to adequately represent the frequency content of the signals. Plot partial sums of the Fourier series for...
Program from problem 1: (Using MATLAB)
% Sampling frequency and sampling period
fs = 10000;
ts = 1/fs;
% Number of samples, assume 1000 samples
l = 1000;
t = 0:1:l-1;
t = t.*ts; % Convert the sample index into time for generation and
plotting of signal
% Frequency and amplitude of the sensor
f1 = 110;
a1 = 1.0;
% Frequency and amplitude of the power grid noise
f2 = 60;
a2 = 0.7;
% Generating the sinusoidal waves...