Borrar filtros
Borrar filtros

Conversion from FFT to IFFT

58 visualizaciones (últimos 30 días)
Nerma Caluk
Nerma Caluk el 11 de Nov. de 2022
Comentada: Star Strider el 14 de Nov. de 2022
Hi,
I have a seismic signal that I have ran thorugh Transfer Functions, with converting it from time-domain to frequency domain using FFT function. Once the transfer functions have been applied, I have tried to bring the signal back to time domain to IFFT, but I am getting only the upper half of the signal (picture attached). Please dont mind the big peak at the end, still need to remove the noise.
G = ifft(Y_corr);
figure
plot(abs(G))
Y_corr is the seismic signal after transfer functions, which needs to be brougth back in time domain. How can I seperate the upper and lower halves of the signal, since "abs" is not really doing that?
Thank You!!!

Respuestas (1)

Star Strider
Star Strider el 12 de Nov. de 2022
It is likely not efficient to do filtering by editing the fft result (although it can be done). If you want to do it that way, the easiest way is to use the fftshift function to create a symmetrical (positive and negative frequency) version of the Fourier transform. Then, apply the ideal filter (or whatever filter you have available) to both sides of the two-sided Fourier transform. After that, apply ifftshift and then take the ifft of that vector.
The shifts would go something like this —
v = 1:9
v = 1×9
1 2 3 4 5 6 7 8 9
v1 = fftshift(v)
v1 = 1×9
6 7 8 9 1 2 3 4 5
v2 = ifftshift(v1)
v2 = 1×9
1 2 3 4 5 6 7 8 9
Experiment with those functions to understand how they work.
However, that is definitely the long way around. Instead, if you want to pass only a range of frequencies, use the bandpass function. (For best results, include the 'ImpulseResponse','iir' name value pair to design an efficient elliptic filter.) There are other ways to design filters if you have the Signal Processing Toolbox and do not have the bandpass function. I will help with that if necessary.
.
  11 comentarios
Nerma Caluk
Nerma Caluk el 14 de Nov. de 2022
Yes, those all look correct! I have already plotted all of them through 'bode' diagrams, and then used lsim function in one of trys that You have recommended couple of weeks ago, but that function conducted convolution instead of deconvolutuion (dividing) of fft and Trasfer function values.
The sampling frequency is 53Hz. The 'w' values is are radians frequnecy, and should simply be w = 2*pi*f
Star Strider
Star Strider el 14 de Nov. de 2022
With the sampling frequency provided —
s = tf('s'); % <— CHANGED
R_g = 1800; % coil resistance [ohms]
R_s = 2680; % damping resistance [ohms]
G_1 = 175; % generator constant of the magnet-coil system [V/(m/s^2)]
G_2 = 23700; % pre-amplifier gain
omega_b = 0.31416; % output high pass cut-off angular frequency (rad./s)
omega_p = 57.1199; % output low pass cut-off angular frequency (rad./s)
f_0 = 1; % responant frequency of the pendulum (Hz)
h = 0.85; % damping constant
S_R = 53; % sampling rate, nominal (Hz)
omega_0 = 2*pi*f_0;
K = 204.8;
% Resistance ratio of the damping circuit
% G = R_s./(R_g + R_s);
% % Transfer function of the seismometer for accleration
% S_p = s./(s.^2 + 2.*h.*omega_0.*s + omega_0.^2);
% % Transfer function of 8-pole output low-pass anti-aliasing filter
% F_l = ([omega_p.^2./(s.^2 + 2.*cos(pi/8).*(omega_p).*s + (omega_p).^2)].^2 ).* [omega_p.^2./(s.^2 + 2.*cos((3*pi)/8).*(omega_p).*s + (omega_p).^2)].^2;
% % Transfer function of single-pole high-pass filter in the output amplifier
% F_a = s./(omega_b + s);
% % Seismometer response for acceleration in flat-response mode
% A_SP = K.*G.*G_1.*G_2.*S_p.*F_a.*F_l; %units V./(m./s.^2)
% s = tf('s');
Ts = 1/53; % Sampling Period
G = R_s/(R_g + R_s);
S_p = s/(s^2 + 2*h*omega_0*s + omega_0^2);
S_pz = c2d(S_p, Ts)
S_pz = 0.01705 z - 0.01705 ---------------------- z^2 - 1.805 z + 0.8175 Sample time: 0.018868 seconds Discrete-time transfer function.
figure
bodeplot(S_p)
grid
F_l = ([omega_p^2/(s^2 + 2*cos(pi/8)*(omega_p)*s + (omega_p)^2)]^2 )* [omega_p^2/(s^2 + 2*cos((3*pi)/8)*(omega_p)*s + (omega_p)^2)]^2;
F_lz = c2d(F_l, Ts)
F_lz = 2.366e-05 z^7 + 0.002952 z^6 + 0.02601 z^5 + 0.04929 z^4 + 0.02647 z^3 + 0.004017 z^2 + 0.0001301 z + 2.964e-07 --------------------------------------------------------------------------------------------------------------- z^8 - 2.794 z^7 + 4.077 z^6 - 3.759 z^5 + 2.352 z^4 - 1.006 z^3 + 0.2832 z^2 - 0.04727 z + 0.00358 Sample time: 0.018868 seconds Discrete-time transfer function.
figure
bodeplot(F_l)
grid
F_a = s/(omega_b + s);
F_az = c2d(F_a, Ts)
F_az = z - 1 ---------- z - 0.9941 Sample time: 0.018868 seconds Discrete-time transfer function.
figure
bodeplot(F_a)
grid
A_SP = K*G.*G_1*G_2*S_p*F_a*F_l;
A_SPz = c2d(A_SP, Ts)
A_SPz = 26.4 z^10 + 7007 z^9 + 9.493e04 z^8 + 1.446e05 z^7 - 2.543e05 z^6 - 2.29e05 z^5 + 1.362e05 z^4 + 9.014e04 z^3 + 1.019e04 z^2 + 212.8 z + 0.2471 ----------------------------------------------------------------------------------------------------------------------------------------------- z^11 - 5.593 z^10 + 14.51 z^9 - 23.28 z^8 + 25.79 z^7 - 20.72 z^6 + 12.3 z^5 - 5.38 z^4 + 1.693 z^3 - 0.3636 z^2 + 0.04776 z - 0.002909 Sample time: 0.018868 seconds Discrete-time transfer function.
figure
bodeplot(A_SP)
grid
b = A_SPz.Numerator
b = 1×1 cell array
{[0 26.3972 7.0068e+03 9.4930e+04 1.4463e+05 -2.5430e+05 -2.2904e+05 1.3620e+05 9.0140e+04 1.0192e+04 212.7577 0.2471]}
a = A_SPz.Denominator
a = 1×1 cell array
{[1 -5.5932 14.5092 -23.2791 25.7894 -20.7184 12.2972 -5.3797 1.6933 -0.3636 0.0478 -0.0029]}
Use ‘b’ and ‘a’ with the Signal processing Toolbox to filter the signals. It might be appropriate to use the tf2sos funciton to produce a stable filter from them, then use that result with filtfilt.
I do not understand what you intend by deconvolving them. My impression was always that you want to filter the signal with them. In any event, you can use these vectors with the deconv function if necessary, since they are now appropriate for a discrete signal.
.

Iniciar sesión para comentar.

Categorías

Más información sobre Matched Filter and Ambiguity Function en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by