m8ta
You are not authenticated, login. |
|
{1280} | ||
Preparation of uniaxially oriented polyamide films by vacuum deposition polymerization
| ||
{585} | ||
LMS-based adaptive decorrelator, xn is the noise, xs is the signal, len is the length of the signal, delay is the delay beyond which the autocorrelation function of the signal is zero but the acf of the noise is non-zero. The filter is very simple, and should be easy to implement in a DSP. function [y,e,h] = lms_test(xn, xs, len, delay) h = zeros(len, 1); x = xn + xs; for k = 1:length(x)-len-delay y(k) = x(k+delay:k+len-1+delay) * h ; e(k) = x(k) - y(k); h = h + 0.0004 * e(k) * x(k+delay:k+len-1+delay)'; endIt works well if the noise source is predictable & stable: (black = sinusoidal noise, red = output, green = error in output) Now, what if the amplitude of the corrupting sinusoid changes (e.g. due to varying electrode properties during movement), and the changes per cycle are larger than the amplitude of the signal? The signal will be swamped! The solution to this is to adapt the decorrelating filter slowly, by adding an extra (multiplicative, nonlinear) gain term to track the error in terms of the absolute values of the signals (another nonlinearity). So, if the input signal is on average larger than the output, the gain goes up and vice-versa. See the code. function [y,e,h,g] = lms_test(xn, xs, len, delay) h = zeros(len, 1); x = xn + xs; gain = 1; e = zeros(size(x)); e2 = zeros(size(x)); for k = 1:length(x)-len-delay y(k) = x(k+delay:k+len-1+delay) * h; e(k) = (x(k) - y(k)); h = h + 0.0002 * e(k) * x(k+delay:k+len-1+delay)'; % slow adaptation. y2(k) = y(k) * gain; e2(k) = abs(x(k)) - abs(y2(k)); gain = gain + 1 * e2(k) ; gain = abs(gain); if (gain > 3) gain = 3; end g(k) = gain; end If, like me, you are interested in only the abstract features of the signal, and not an accurate reconstruction of the waveform, then the gain signal (g above) reflects the signal in question (once the predictive filter has adapted). In my experiments with a length 16 filter delayed 16 samples, extracting the gain signal and filtering out out-of-band information yielded about +45db improvement in SNR. This was with a signal 1/100th the size of the disturbing amplitude-modulated noise. This is about twice as good as the human ear/auditory system in my tests.
It doesn't look like much, but it is just perfect for EMG signals corrupted by time-varying 60hz noise. | ||
{757} | ||
My friend Joey recently showed me the trailer to "The Road", and I banefully observed that it was "yet another disaster film". This made me wonder if the number of disaster films is increasing with time - a question that was easily answered with the help of perl, matlab, and Wikipedia's list of disaster films. First, I saved the page, then converted the list of dates contained therein into a matlab-formatted string with the following quick-n-dirty script: $source = $ARGV[0]; open(FH, "< $source"); @j = <FH>; #slurp the entire file into one string. print "dates = ["; $first = 1; foreach $l (@j){ while ($l =~ /\((\d{4})\)/gs ){ if(not $first){ print ","; } print $1 ; $first = 0; } } close FH; print "]; \n"; then plotted it in matlab: hist(dates, 20) %average over 5-year periods yielding: thereby validating my expectations that the number of disaster films has increased with time! (Note i did not say the percentage of total films - that might be constant :-) | ||
{586} | ||
Myopen amplifiers & analog/digital filters & NLMS are working properly! Below, a recording from my deltiod as I held my arm up: (only one EMG channel active, ground was my knee)) Yellow traces are raw inputs from ADC, blue are the output from the IIR / adaptive filters; hence, you only see 8 of the 16 channels. Read from bottom to top (need a -1 in some opengl matrix somewhere...) Below, the system with no input except for free wires attached to one channel (and picking up ambient noise). For this channel, NLMS could not remove the square wave - too many harmonics - but for all other channels the algorthim properly removes 60hz interference :) Now, let me clean this EEG paste off my shoulder & leg ;) |