Exemplo n.º 1
0
void wlet_tellmeeverything(t_wlet *x){
	version(0);
	post("Direction: %s", x->w_direction == forward ? "forward" : "backward");
	post("Wavelet type: %s", gsl_wavelet_name(x->w_wavelet));
	post("k = %ld", (long)x->w_k);
	post("Size: %d", x->w_waveletLength);
}
Exemplo n.º 2
0
void wlet_int(t_wlet *x, long n)
{
	float f = (float)n;
	int i = (int)n;
	
	if(proxy_getinlet((t_object *)x) == 1){
		wlet_setupWavelet(x, gensym((char *)gsl_wavelet_name(x->w_wavelet)), (size_t)n);
	}else if(proxy_getinlet((t_object *)x) == 2){
		if(n > sys_getblksize()){
			error("wavelet: size must be smaller than the signal vector %ld", sys_getblksize());
			return;
		}
		while(i > 1){
			f = f / 2.0;
			if(f - round(f)){
				error("wavelet: size must be a multiple of 2");
				return;
			}
			i = (int)f;
		}
		x->w_waveletLength = (int)n;
		
		gsl_wavelet_workspace *oldWspace = x->w_workspace;
		x->w_workspace = gsl_wavelet_workspace_alloc((size_t)n);
		gsl_wavelet_workspace_free(oldWspace);
		
		double *oldTmp = x->w_tmp;
		x->w_tmp = (double *)calloc((int)n, sizeof(double));
		free(oldTmp);
	}//else if(proxy_getinlet((t_object *)x) == 3){
	//	x->w_stride = (size_t)n;
	//}
}
Exemplo n.º 3
0
static VALUE rb_gsl_wavelet_name(VALUE ww)
{
  gsl_wavelet *w = NULL;
  Data_Get_Struct(ww, gsl_wavelet, w);
  return rb_str_new2(gsl_wavelet_name(w));
}