Question: I currently have the following code: load('Data1B.mat', 'fs', 'muxSignal');% %Create Sampling Period Ts = 1/fs; %Time Domain Vector t = linspace(-Ts/2, Ts/2, length(muxSignal)+1); t =
I currently have the following code:
load('Data1B.mat', 'fs', 'muxSignal');%
%Create Sampling Period
Ts = 1/fs;
%Time Domain Vector
t = linspace(-Ts/2, Ts/2, length(muxSignal)+1);
t = t(1:end-1);
%Plot muxSignal
figure;
hold on;
plot(t,muxSignal)
title('muxSignal')
xlabel('Time (s)')
ylabel('Amplitude')
%Fourier Transform muxSignal
MUX = fft(muxSignal);
%Frequency Vector
k = linspace (-fs/2, fs/2, length(MUX)+1);
k = k(1:end-1);
%MUX_fftshifted scale
MUX_fftshifted = fftshift(MUX/fs);
%Plotting Magnitude
figure;
hold on;
plot(k, abs(MUX))
title('MUX')
xlabel('Time (s)')
ylabel('Magnitude')
Where Data1B.mat contains 2 variables loaded into the workspace of muxSignal and fs. Complete the following without this file, pretend as the variables are real.
The peaks in the magnitude spectrum give the precise locations of the frequency shifts. Identify the location of the peaks in the positive frequencies (you may use an inbuilt MATLAB function) and store them inside a row vector called fshift in ascending order.fshift values should be whole numbers, round to the nearest integer if necessary.
Find the magnitude and phase of these peaks. Store the results in row vectors Mag andPhishift respectively. The values in these vectors need to correspond to their respective frequencies in fshift. Create a new figure and overlay the locations and magnitudes of the frequency shifts using green circles on the magnitude spectrum of MUX. You will have between 4 and 6 green circles.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
