 	shrd_param_id = shmget( SHM_PARAM_KEY, sizeof(struct SHM_PARAM), 0444);
 	param_ptr = (struct SHM_PARAM *)shmat(shrd_param_id, NULL, 0);
 	segdata_ptr = (float *)shmat(param_ptr->shrd_seg_id, NULL, SHM_RDONLY);
+	xspec_ptr   = (float *)shmat(param_ptr->shrd_xspec_id, NULL, 0);
 /*
 -------------------------------------------- K5 Header and Data
 */

	cufftDestroy(cufft_plan);
	cudaFree(&cuReal_data);
	cudaFree(&cuSpec_data);
    return(0);
}

#include <cutil.h>
#include <cufft.h>
#define	NFFT		262144
#define	NSEG		64

__device__ float2 complexMult(float2 a, float2 b)		// output a x b
{
