I have a Lorentzian frequency distribution
$F(w) = \frac{1+iz}{1+z^2}$
Where
$z = \frac{w-\Omega}{R}$
With $\Omega$ being the peak frequency and R the decay constant. I know that analytically the Fourier transform should be
$F(t) = exp(i\Omega 2\pi t)exp(-Rt)$
When i take the FFT of this expression, it doesn't return the original frequency plot. I understand that there may be a scaling factor (1/n) that should be in there somewhere, but even when i scale for one frequency, if i then change $\Omega$ or R, the amplitude is no longer scaled properly, suggesting that the scaling factor is a function of $\Omega$ and/or R. The FFT also seems to be mirrored along the intensity axis.
I'm fairly new to DSP, but i do understand that the continuous fourier transform is not the discrete fourier transform. I've read this (https://dspillustrations.com/pages/posts/misc/approximating-the-fourier-transform-with-dft.html) but that approach makes the approximation worse.
I'd like to return the original frequency distribution when i take the FFT of my time signal. Am i missing something fundamental or is it a fairly simple scaling error? I've attached my code below.
Cheers.
# R script to compare FFT and Analytical fourier transform
library(SynchWave)
#-------------------------------------------------
# Frequency and time axes
n <- 100
f <- seq(0, 1, length.out = n)
t <- seq(0, n, length.out = n)
# peak paramaters
O <- 0.3 # Frequency values from 0->1
R <- 0.04 # Decay in arbritrary units
z <- (f-O)/R
# The original lorentzian frequency
ff <-complex(re = 1, im = z)/(1 + z^2)
# creating the time domain signal
ftideal <- exp(-R*t)*exp(complex(i = (O)*2*pi*t))
unscaled <- (fft(ftideal))
scaled <- unscaled - min(Re(unscaled))
plot(f, Re(ff), type = 'l')
lines(f, Re(scaled), type = "l", col = 'red')
```