<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fmsin(N, fnormin=0.05, fnormax=0.45, period=None, t0=None, fnorm0=0.25, pm1=1):
 """ Signal with sinusoidal frequency modulation. generates a frequency modulation with a sinusoidal frequency. This sinusoidal modulation is designed such that the instantaneous frequency at time T0 is equal to FNORM0, and the ambiguity between increasing or decreasing frequency is solved by PM1. N : number of points. FNORMIN : smallest normalized frequency (default: 0.05) FNORMAX : highest normalized frequency (default: 0.45) PERIOD : period of the sinusoidal fm (default: N ) T0 : time reference for the phase (default: N/2 ) FNORM0 : normalized frequency at time T0 (default: 0.25) PM1 : frequency direction at T0 (-1 or +1) (default: +1 ) Returns: Y : signal IFLAW : its instantaneous frequency law Example: z,i=fmsin(140,0.05,0.45,100,20,0.3,-1.0) Original MATLAB code F. Auger, July 1995. (note: Licensed under GPL; see main LICENSE file) """


    if period==None:
	period = N
    if t0==None:
	t0 = N/2
    pm1 = nx.sign(pm1)

    fnormid=0.5*(fnormax+fnormin);
    delta  =0.5*(fnormax-fnormin);
    phi    =-pm1*nx.arccos((fnorm0-fnormid)/delta);
    time   =nx.arange(1,N)-t0;
    phase  =2*nx.pi*fnormid*time+delta*period*(nx.sin(2*nx.pi*time/period+phi)-nx.sin(phi));
    y      =nx.exp(1j*phase)
    iflaw  =fnormid+delta*nx.cos(2*nx.pi*time/period+phi);

    return y,iflaw