/****  pfeif.c calculates every possible mixing product ***/
/****  in the considered 50db bandwidth                 ***/
/****  Joerg Braune Jan 01 2003                         ***/

#include <stdio.h>  

main()
{
    double rf,lo,intermedf,halfbw,akku;
    float m,n;

    /* enter the frequencys   */

    printf("key in the RF frequency:\n");
    scanf("%lf",&rf);

    printf("key in the LO frequency:\n");
    scanf("%lf",&lo);

    printf("key in the IF frequency:\n");
    scanf("%lf",&intermedf);

    printf("key in the 50dB Bandwidth:\n");
    scanf("%lf",&halfbw);


    /* nested loop   */
    for ( m=-20 ; m<21 ; m++)
    {	
		/*outer loop  */
		for ( n=-20 ; n<21 ; n++) 
        {						
            /* inner loop */
            akku = m*rf+n*lo;
            if( (intermedf-halfbw) < akku )
            {   
                if( (intermedf+halfbw) > akku )
                {	
                    printf("mixerproduct=%2.3f\n",akku);
                    printf("m=%2.3f\n",m);
                    printf("n=%2.3f\n",n);
                }
            }
        }
    }
}
/**** end of program ***/
