Frequency Spectrum plot of original and reconstructed signal

1 view (last 30 days)
I have an original signal and a reconstructed signal using first order hold and i want to plot both their frequency spectrum plots. Can you guide me how to do so
t=0:0.01:1;
x=sin(2*pi*f*t);
t2=linspace(0,1,1/0.01);
n=0:1/fs:1;
x1=interp1(n,xs,t2,'linear'); %xs is discrete signal
  1 Comment
Paul
Paul on 16 Jan 2023
Edited: Paul on 16 Jan 2023
The following variables are not defined: f, fs, and xs. Even if they were, it's unclear what the objective is. x is a signal sampled at 100 Hz. Is x1 supposed to be x interpolated to higher sampling frequency?
Also, linear interpolate isn't really a first-order-hold (FOH). The FOH exrtrapolates from the previous two points in the signal. Linear interpolation interpolates between the current point and the next point.

Sign in to comment.

Answers (0)

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!