comp.soft-sys.matlab - The MathWorks calculation and visualization package.
Hello, I am trying to estimate the transfer function as a form k*1/s^2 using chirp signal(0.1Hz - 100Hz at the sampling time of 0.0025s). But two bode plots of the transfer functions, one from the true transfer function, the other from fft calculation, are not matching. I made a simulink model with a chirp block as an input, a transfer function block of 1/s^2, and two 'To Workspace block' to save the input, output data. After running the simulation of my model, I run my fft m-file to do fft, calculate the estimated transfer function as fft(output)./fft(input), and plot the bode diagram. Then I expected the bode plot of the result from fft would match the bode plot of true 1/s^2, but they are not matching at all. The bode plot from fft calculation looks to have -10 db slope instead of -20 db slope and have higher magnitude than the true one. However, if I try to estimate 1/(s^2 + 0.25s + 1), both bode plots from fft and the true transfer function are exactly matching. I wonder what is making the difference between two bode plots for 1/s^2. Is there anyone who had this kind of problem? I appreciate your help in advance. Thanks Jinwoo
I am doing an FFT of a chirp function. I am having problems with realizing the FFT! The FFT should when p =1 loo like the signal in. It doesn't Any suggestions?! Thanks... The following is the m-code: function s = dtFMchirp(p,TW) % DCHIRP generate a sampled chirp signal % usage s = dchirp(TW,p) % s : samples of a digital "chirp" signal % exp(j(W/T)pi*t^2) -T/2 <= t < T/2 % TW : time-bandwidth product % p : sample at p times the Nyquist rate (W) %p=10; %TW=50; %N = p*TW; %n = 0:N; %alpha = 1/(2*p*p*TW); %s = exp(j*2*pi*alpha*((n-.5*N).^2)); %x=real(s); %plot(x); %length1=length(x); %figure; %fftx=fft(x,length1); %fftx=abs(fftx); %plot(fftx); close all; clear; p=1; TW=50; N = p*TW; n = 0:N; alpha = 1/(2*p*p*TW); s = exp(j*2*pi*alpha*((n-.5*N).^2)); figure(1); x=real(s); plot(x); length1=length(x); fftx=fft(x,length1); k=round(length1/2); fftx=[fftx(k:end) fftx(1:k)]; fftx=abs(fftx); fftx=abs(20*log10(fftx)); x=-2:4/length1:2; figure(3) plot(fftx);
Dear All, Could someone tell me how to implement INVERSE chirp z transform in Matlab. Matlab has chirp z transform in signal processing toolbox but no inverse - I read somewhere that it is possible to obtain inverse chirp z transform by using chirp z transform. How to do it? Maybe somebody would be willing to shed some light. Regards Pawel
I have a problem with using the Wigner function and representing a linear chirp signal in the time-frequency domain. When I use my algorithm and the fft function the mesh plot shows a signal whose frequency is decreasing with time whereas the signal clearly represents a signal whose frequency is increasing linearly with time. I believe that the autocorrelation function is correct but I am not getting the right graph and suspect that the fft command is not performing correctly. Grateful for any hints!!!!!!!!!!!!!!!!!!! fs = 500; % Sample frequency N = 512; % Signal length f1 = 20; % Starting frequency in Hz f2 = 200; % Frequency after 1 second (end) in Hz T=(1/fs); % Sample Period % Construct “chirp” signal t = (1:N)/fs; s = chirp(t,f1,1,f2); % Chirp based on array t % Wigner-Ville analysis figure ; plot(s); xlabel('Point'); % Axis labels soundsc(s,fs); % Play signal s = hilbert(s); % Get analytic function to remove problems with cross products %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Converts input signal to Column Vector if not already so [N,scol] = size(s); % N,scol represents number of rows and cols respectively if N < scol % Make signal column vector s = s'; % Standard (non-complex) transpose N = scol; end R = zeros(N,N); % Initialize output t = (1:N)/fs; % Calculate time vector f = (1:N)*fs/(2*N); % Calculate frequency vector for k = 1:N; lagmax = min ([k-1,N-k,round(N/2)-1]); lag = -lagmax:lagmax; R(lag + round(N/2),k) = s(k+lag).*conj(s(k-lag)); end R = circshift(R,round(N/2)+1 -mod(N,2)); WD = 2*T*real(fft(R)); % Returns the discrete fourier tranform of WD figure; mesh(t,f,WD); % Mesh Plot view(2); hold on; xlabel('Time'); % Axis labels ylabel('Frequency');