
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
x1 = a1*sin(2*pi*f1*t); % Sensor wave
x2 = a2*sin(2*pi*f2*t); % power grid wave
% Generating the zero-mean random noise
noise = randn(1,l);
% Adding all the waves and random noise
signal = x1 + x2 + noise;
% Plotting the signal
figure,plot(t,signal)
xlabel('Time in seconds')
ylabel('Amplitude')
title('Noisy signal with 110 Hz sensor signal and 60 Hz power grid
noise')
% Performing FFT on the signal
xk = fft(signal, l);
% Calculation of magnitude of the spectrum coefficients
xkabs = abs(xk);
% Plotting the single sided magnitude spectrum
f = 0:1:500;
figure,plot(f*(fs/l),xkabs(1:501))
xlabel('Frequency in Hz')
ylabel('Magnitude')
title('FFT of Noisy signal')
% 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
x1 = a1*sin(2*pi*f1*t); % Sensor wave
x2 = a2*sin(2*pi*f2*t); % power grid wave
% Generating the zero-mean random noise
noise = randn(1,l);
% Adding all the waves and random noise
signal = x1 + x2 + noise;
% Plotting the signal
figure,plot(t,signal)
xlabel('Time in seconds')
ylabel('Amplitude')
title('Noisy signal with 110 Hz sensor signal and 60 Hz power grid
noise')
% Performing FFT on the signal
xk = fft(signal, l);
% Calculation of magnitude of the spectrum coefficients
xkabs = abs(xk);
% Plotting the single sided magnitude spectrum
f = 0:1:500;
figure,plot(f*(fs/l),xkabs(1:501))
xlabel('Frequency in Hz')
ylabel('Magnitude')
title('FFT of Noisy signal')
Program from problem 1: (Using MATLAB) % Sampling frequency and sampling period fs = 10000; ts...
I wrote a Matlab program for the figure below. When I plot the waves, they look the same. Why do the two waves frequencies look same and How do I avoid it? (I really do need this part of the question answered.) N = 200; % Total number of time domain samples in simulation. Fs = 100 ;% sampling frequency. F1 = 10; % frequency of wave - 1. F2 = 90; % frequency of wave - 2. phi =...
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.
how to do laplace transform on a signal that is in frequency domain. I have a signal that is in time domain and i used fft to plot it in the frequency domain, is there a way i could plot it in s domain. I know that i could do laplace transform directly from time domain to s domain, but I need to find out are these two results match each other. Fs = 4; % samples per second dt...
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...
Reproduce Figures 9.2b and 9.2c on MATLAB, assuming that the
square wave (Figure 9.2b) is a periodic symmetric square wave of
normalized amplitude (A=1). Each student group should
decide the power spectral density level of the channel noise.
Compute the Fourier transform of the periodic square wave.
clear all
close all
%%%%
T=12*pi; %number of period
x=linspace(0,T);
t=x/pi
y0=square(x); %square wave signal
y0ft=fft(y0); %calculating Fourier Transformof signal
y0fts=fftshift(y0ft);
y0ftFinal=abs(y0ft);
AWGN= rand(size(x)); %Calculating whit noise
Att=(1/3);
nSig= Att*AWGN;
y=y0+nSig; %Square wave...
NB! This task is required to be solved in matlab. this task also requires the use of the function displayDualSpectrum();
which i have pasted in the bottom. the tasks that i need help with are A), B) and C). this is a multi-part question.
Task - Frequency mixing
We use a basic signal that can be described mathematically as follows:
with this We shall then make an amplitude modulated signal: where fc is the carrier frequency. the code below specifies...
Need help converting the following code from Matlab into Python: N=2048; fs=4.9; t=0:1/fs:(N-1)/fs; fs1=200; t1=0:1/fs1:(N-1)/fs1; x2=0.5+0.6366.*cos(2.*pi.*t1)+0.1273.*cos(10.*pi.*t1)-0.0909.*cos(14.*pi.*t1); x=0.5+0.6366.*cos(2.*pi.*t)+0.1273.*cos(10.*pi.*t)-0.0909.*cos(14.*pi.*t); X=fftshift(fft(x)); f=linspace(-fs/2,fs/2,N); plot(f,abs(X)./N); xlabel('f'); ylabel('|F(f)|'); title('magnitude spectrum of sampled signal'); x1=ifft(fftshift(X)); figure plot(t(1:100),x1(1:100)); xlabel('t'); ylabel('f(t)'); title('f(t) obtained by inverse transform'); figure plot(t1(1:1000),x2(1:1000)); xlabel('t'); ylabel('f(t)'); title('original f(t)');
using Matlab: 1) Design an FIR notch filter using zero placement to remove power-line noise at 60 Hz (use file ecg_60hz_200, fs = 200 Hz). 2) Design a LP Butterworth filter with cut-off frequency of 40 Hz to remove high-frequency noise (use file ecg_hfn.dat, fs = 1000 Hz). 3) Design an Elliptic HP filter with passband ripple of 0.01 dB and stopband attenuation of 50 dB and cut-off frequency of 0.5 Hz to remove low-frequency noise (use file ecg_lfn.dat, fs...
Can you please help me answer Task 2.b?
Please show all work.
fs=44100; no_pts=8192;
t=([0:no_pts-1]')/fs;
y1=sin(2*pi*1000*t);
figure;
plot(t,y1);
xlabel('t (second)')
ylabel('y(t)')
axis([0,.004,-1.2,1.2]) % constrain axis so you can actually see
the wave
sound(y1,fs); % play sound using windows driver.
%%
% Check the frequency domain signal. fr is the frequency vector and
f1 is the magnitude of F{y1}.
fr=([0:no_pts-1]')/no_pts*fs; %in Hz
fr=fr(1:no_pts/2); % single-sided spectrum
f1=abs(fft(y1)); % compute fft
f1=f1(1:no_pts/2)/fs;
%%
% F is the continuous time Fourier. (See derivation...
(a) Determine the period, amplitude, and frequency of a signal given by, v(t) (120nt). Plot this signal both in the time-domain and frequency domain. (b) For the following square wave v(t), determine if it is a periodic signal, and if yes, what 10 V sin 4. [61 are its amplitude, period T and fundamental frequency f? Why do we need to convert this signal into sine/cosine wave for transmission? 2 o-oims (c) () According to Fourier Theorem, the above signal...