mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	audioconvert: tweak resampler window some more
By: Kevin Yin R->A calculation removed: it wasn't valid anyway. No behavior change. Placed existing A in there directly. cosh window -> strangely tweaked exp window: remove the discontinuity at the border, which is wrong for a window function. If A changes in the future, this window will be better. With the current A, you will not be able to tell the difference on any graph. (Of course, it's not a cosh window anymore.) Fixes #2574
This commit is contained in:
		
							parent
							
								
									5a8af97a40
								
							
						
					
					
						commit
						0bf7911b37
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -68,14 +68,15 @@ static inline double window_blackman(double x, double n_taps)
 | 
			
		|||
}
 | 
			
		||||
static inline double window_cosh(double x, double n_taps)
 | 
			
		||||
{
 | 
			
		||||
	double R = 190.0, r;
 | 
			
		||||
	double A = (-325.1E-6 * R + 0.1677) * R - 3.149;
 | 
			
		||||
	double r;
 | 
			
		||||
	double A = 16.97789;
 | 
			
		||||
	double x2;
 | 
			
		||||
	x =  2.0 * x / n_taps;
 | 
			
		||||
	x2 = x * x;
 | 
			
		||||
	if (x2 >= 1.0)
 | 
			
		||||
		return 0.0;
 | 
			
		||||
	r = cosh(A * sqrt(1 - x2)) / cosh(A);
 | 
			
		||||
	/* doi:10.1109/RME.2008.4595727 with tweak */
 | 
			
		||||
	r = (exp(A * sqrt(1 - x2)) - 1) / (exp(A) - 1);
 | 
			
		||||
	return r;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue