How to determine time-domain amplitude from frequency domain
Afficher commentaires plus anciens
I'm a bit stuck here, so any help is appreciated.
So I'm trying to derive the amplitude (time-domain) of a damped sine from the frequency domain. As a test case I'll be generating my damped sine so I know what the amplitude should look like. For my I application I will not be able to do so as I will be using real signals that I dont have the parameters for (I am actually deriving them!)
The only parameter I'm struggeling with is the amplitude, I got my frequency, phase and damping with less than 1% error. My original signal looks like the snippet below and note that I only have a few samples (100!).
fs = 2e6;
t = 0:(100-1);
b = -zeta*2*pi*freq/fs;
c = 2*pi*freq/fs;
x = ampl*(exp(b.*t)).*sin(c*t+phi/180*pi);
I apply a Hamming window to my signal and perform an fft. Run it through my algorithm and I get accurate parameters for Freq, Zeta and Phi (frequency, damping and phase). So you may assume that those are known. I do compute a magnitude (i.e. amplitude in frequency domain, I'll refer to it as magnitude to prevent ambiguity) however I'm unable to correlate it to the initial (time-domain) amplitude.
Given that I can reconstruct the original signal exactly with an ifft I would imagine that I could derive the time-domain amplitude, below I've provided a working example that reconstructs the input signal.
%% parameters to construct signal
fs = 2e6;
freq = 180e3;
ampl = 44;
phi = 0;
zeta = 0.12;
n_sample = 100;
t = 0:(n_sample-1);
%% construct signal
b = -zeta*2*pi*freq/fs;
c = 2*pi*freq/fs;
x = ampl*(exp(b.*t)).*sin(c*t+phi/180*pi);
x=x';
%% Apply window, zeropad and FFT
w = hamming(length(x));
y = [w.*x; zeros(28,1)];
xFFT = fft(y)/length(y);
%% Inverse FFT
w = [w; ones(28,1)];
z = ifft(xFFT.*length(y))./w;
%% Plot
figure()
hold on
plot(x)
plot(y)
plot(z)
legend('original', 'windowed', 'reverse')
Any ideas on how I can compute the initial amplitude? So in the example above, how I can find 44?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Spectral Measurements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!