function [x, N] = gchirp(N,fmin,fmax);
% function [x, N] = gchirp(N,fmin,fmax);
% 
% generates a chirp with gaussian amplitude and 
% linearly varying frequency.
%
% input parameters:
%     N     number of points 
%     FMIN  starting freq.
%     FMAX  final freq.
%
% output parameters:
%     X output chirp signal
%
% see also: sprspplot
%
% example:
%  Nx = 16 ; fmin = 0 ; fmax = 0.5 ;
%  x  = gchirp(Nx,fmin,fmax);

% P. Flandrin, Feb. 12, 2001
% [Time-frequency reassignment: from principles to algorithms]
% Figure 3

N = odd(N)-1;

% linear FM
[xl,fxl] = fmlin(N,fmin,fmax);

% Gauss AM
x = xl.*amgauss(N,N/2,N/3);
