Posts

Showing posts from June, 2008

Selective Attenuation

Image
We can alter the FID at our advantage. It's enough to multiply the complex FID with a positive real function. Many functions have been proposed and it's difficult to find other common properties among them. Most have zero intensity at the end, but there are also exceptions. To do something useful with these functions you must be aware of your particular needs. Think in terms of: "What do I want to attenuate?". The name "Weighting" only describes the "how". A description of the "why?" would be: "Selective Attenuation". I have counted 4 things that can be attenuated. 1) NOISE After multiplication with a negative exponential (2 Hz) this spectrum becomes: 2) LORENTZIAN TAILS The tails of NMR peaks are much larger than you may think. The components of a multiplet are often fused into a single group. In this case, the apparent distance of two positive Lorentzian curves is less than the actual distance. I can attenuate the tails and o...

Success

Image
With my great surprise, the number of visits to this blog reached a peak yesterday: 95. While the number in itself is still miserable, the average is even worse: 65. It's a mystery why I have attracted the highest number of visitors the day I had less things to say. If the picture was the cause of such a success, let me try it again. It's the same subject in Leopard style. I have added new links into the sidebar.

Interlude

Image
It's not elegant to start a new topic on Friday. Before tackling new difficult concepts, an interview is more relaxing. In almost two years of blogging, this is our first interview, and a special one, with my alter ego Giuseppe Balacco, author of iNMR (the name says it all). I meet Giuseppe in a hot summer afternoon. He is sweating into his hot room, watching at the quotes of the stocks on the monitor and listening to one of his records. The first questions are almost instinctive. Q. Are you monitoring your stocks ? A. I only had �10K invested, for 3 months. I sold everything one month ago, with a gain of 300, more or less. I am lucky that I have no money to invest, because these prices are too luring to resist. Actually I suspect that stocks are, still, way too overpriced, and they will keep falling for a long time. Italian stocks at least can keep falling for another couple of years: there's no parachute. It's funny to watch these movements, because they are unpredictab...

Frontier

Image
I have no experience with line-fitting in 2-D and 3D spectra. I have never studied it and don't know what people have already done and which is the current approach. This is a blog and I want to use it like a blog, to express my ideas. I hope you'll also want to treat it like a blog, not as a textbook. If one day I am going to put my hands into this matter, my ideas will certainly evolve, as it always has been when passing from planning to real problem-solving. nD spectra are more problematic than 1D spectra: There are more parameters to estimate (the double in 2D and the triple in 3D). There are less experimental points. The shape is not Lorentzian, because the FID is multiplied by weighting functions. A direct solution is to simulate the FID with exponentially damped sinusoids, apply the same weighting that has been applied to the spectrum, and compare the synthetic spectrum with the real counterpart. The fitting algorithms, alas, require the partial derivatives. I can't ...

Blindly

Image
In the last few days I have been giving the impression that line-fitting is much more time-consuming, difficult and error-prone than integration. It's true, not because line-fitting is more complicated, but because integration is simpler. There are also notable exceptions. The last tutorial published on www.inmr.net illustrates the case. Here is the spectrum to "integrate": It's the kinetic study of a chemical reaction. Not only the concentrations change, but also the frequencies. That's not at all a problem. If you give a look at the article, you see that it's possible to measure the concentrations of all the diagnostic peaks in all the spectra with a single operations. In other words the whole job, including the formatted table of the estimated areas, can be done by the computer in automatic fashion. In this case, they exploit that fact that line-fitting not only gives the intenisities, but the frequencies too. In this way it's easy for the computer to ...

Factorize!

Image
Yesterday I introduced the subject of curve-fitting. Today we'll examine the practical details. A computer can do breathtaking things, like finding out 10 parameters in less than 1 seconds. If you rely too much on it, however, you will be often disappointed. Treat it like a thoroughbred and the computer will serve you faithfully. The first principle is to split any problem in parts. Although you can build a model that accounts for phase and baseline distortions, that's a wrong strategy. Spend all the time required for professional phase- and baseline- corrections. Then start assuming that your spectrum only contains lorentzian peaks. You also have the precious weapon of gaussian lineshapes. They are not a natural shape into NMR spectra, therefore use them as little as possible. There are programs able to search for the optimal mix of functions. You can try this option too (when noise is moderate). Normally the result will be > 90% Lorentzian. When it happens, stick to purel...

The Name of the Game

Image
Waves are only one kind of the shapes we can fit. In time domain we only have waves. In frequency domain the variety of shapes is higher. Peaks can be well approximated with Lorentzian curves, but in rare cases an anomalous spike can be better fitted with a Gaussian curve or a combination of the two kinds. Weighted FIDs generates all kinds of shapes, presumably. Another familiar profile is the dispersion Lorentzian curve, which also has its own math expression. In theory anything can be fitted by an HIGH degree polynomial, but in practice that is only appropriate for the baseline. Fitting the experiment to a model is a general procedure that goes well outside the world of NMR. In our little world it is commonly called "deconvolution". Is it the same outside? While this is a word with a gentle sound, and I like using single words instead of long expressions, I think that the name is not appropriate, also because deconvolution has its own meaning and math expression. When you a...

Looking Back

Image
Several methods have been proposed to calculate the LP coefficients; the fact that no clear winner has emerged demonstrates that it's a tricky task. My choice was casual. I remember being into the library (it was probably 1991), browsing the latest issue of a chemistry journal (don't remember which) where I probably I read the expression "Linear Prediction" for the first time in my life. What I remember with certainty are the names of the author: Gesmar and Led. They were discussing the application of a novel algorithm ("Fast Linear Prediction"). Curious to see it in action, I wrote to the duo asking for the source code. They replied that the code was available for sale, and the price resulted to be higher than my monthly salary. What they were selling in practice was the FORTRAN source code of a program written for the VAX. A program with a single routine. I had no FORTRAN compiler, no VAX machine and no idea about a practical application of LP that could j...

Looking Forward

Image
The polygons are the idealized shapes of the FIDs of dioxane (green) and water (red). We suppose that the magnetization of water decays much faster, just to see what could happen in extreme cases. We also assume that, when the signal decays under a certain level, it has no more effect on the detector (in other words, it's zero). In both FIDs the evolution of the signal can be summarized with a single parameter, given by the ratio of any two contiguous points. They can be taken from the beginning or the end of the FID, it's just the same. Once we have the prediction parameter, we can prolong the FID indefinitely. (In the red case, there's no difference between forward linear prediction and zero-filling). Now let's mix dioxane and water: As explained yesterday, now we need 4 contiguous points at least to extract the two prediction coefficients. We can't choose them from the beginning of the FID (dominated by the water signal) because there is no more water in the port...

Clockwork

Consider a sample of pure water, with a single NMR resonance. After we excite it, we have created a magnetization vector that rotates into the xy plane. We observe the magnetization at regular intervals. The show soon becomes dull and repetitive. Actually, after the first two observation, we can already predict all the remaining ones. Let F1 be the phase observed initially, and F2 the next sampled phase. We can calculate: ? = F2 - F1. ? remains the same for every couple of consecutive observations. For example, we can predict: F3 = F2 + ?. F4 = F3 + ?. Because the intervals are all equal. The value of ? must be related to the frequency of the signal, of course, but we need not to know neither the relation nor the frequency. There's a difference between the magnetization vector and the hands of a clock: the former is subject to exponential decay. After we have measured the intensity of the magnetization twice, let I1 and I2 be the two values, we can calculate: a = I2 / I1 . a must b...

Nothing Is Better

A few months ago I commented on zero-filling on Glenn Facey's blog . I have reordered my own comments and here they are. In the following I mention Linear Prediction (LP). It's a technique I am going to explain tomorrow. "Maybe a few readers of this blog, less fond of math, can better understand the following simple recipe. In high resolution 1D NMR, usually the signal has already decayed to (practically) zero at the end of the FID. In this case zero-filling and forward Linear Prediction should yield the same results, but the former is better (faster and more robust). When, for whichever reason, the signal is truncated, the preference goes instead to LP. The statement "it is only forward linear prediction which adds new information to the spectrum" is not correct. 1. LP can't add any authentically NEW information because it simply extrapolates the information already contained into the FID. 2. Zero-filling has the property to recover the information contained...

Size Does Not Matter

Image
Zero-filling can't be dangerous. Here is the practical demonstration. I have created an artificial FID with 10 ideal signals (decaying exponentials). All the signals have the same widths and all are truncated. If I apply zero-filling from the original 4096 points up to 32,000, the spectrum shows bad-looking wiggles. If you only look at this picture, it seems that zero-filing is a cause of problems. It is true that, without zero-filling, there would be no wiggles. Let's try to FT the original 4096 points directly: Hear: this spectrum is perfectly phased. When I have created the FID, the waves were all in phase. The experiment demonstrates that truncation causes an asymmetric shape change. Zero-filling, if applied to a truncated spectrum, restores the symmetry (beneficial effect) but at the cost of introducing wiggles (side effect). black: truncated FID + FT red: truncated FID + zero-filling + FT Zero-filling is not responsible for the truncation. It has stressed in a special wa...

2D Plot

When I am tired of sitting in front of the computer, I have two options. If I go to the countryside, I see litter along the roads, and that's not an inspiring sight. If I go to the harbor, it's more romantic, thanks to the water that covers and hides what's below. I know that there can be plenty of litter under there, but it's invisible and I enjoy the scenery. In NMR spectroscopy, 1D plots are the countryside, where you are forced to see the noise, 2D plots are the seaside. When I was a beginner, I was tempted to dry the sea to observe the hidden treasures. I found none. There's only litter at the bottom. Now the level of my spectroscopic sea is sensibly higher, but I am still the master of the tide and keep playing with it. The computer programs are obsessed with the idea of expressing the intensity of the signals through color. I have already discussed this point in the past. There are two kinds of plots to consider. One is the bitmap or fast plot (like a photo),...

1D Plot

Drawing a spectrum is not the most stupid thing a computer can do. Actually it requires a lot of patience and dedication, both for a programmer and a user. All the computer has to do, in the case of a 1D spectrum, is to connect adjacent points. They are also equally spaced, along the x axis. Where's the complication? Furthermore, little has changed in the last 20 years. The only change I notice is that there are less plotters around today, which means more room in the lab, less machines to maintain and less drawing routines into the program. Unfortunately computers seems to follow the Murphy's law: they always find a way to complicate my life. I told you that I installed Jeol Delta, courtesy of Jeol, but it's too difficult for me to use. It draws spectra wonderfully, into a small pane, and I don't know how to enlarge it (I'd like to see the plot as large as my monitor). That's not a big issue, because Delta would still remain too complicated for me to use it. I ...

What's Old

If you are still waiting for reviews of programs, you are in good company. I have realized that it's arduous, particularly when nobody gives you a program. If you want to write the reviews, I can share with you the authorship of the blog. From tomorrow I return blogging regularly (daily?) with a new series of articles dedicated to the old and established computing methods used in high resolution NMR of liquids. There will be very little of mathematical nature (but if you understand, for example, why we can't divide by zero, that would be beneficial). I will express my personal inclinations, and share what I have learned through experience. To really understand why, sometimes, a method yields poor results, you need to recompile the code of the program with statements like: printf ("coeff. no. %d = %5.5f\n", i, coeff[i]); If you haven't access to the code, you can still learn a lot of things by simply looking at the plot on the monitor. In some cases it can be neces...

Stan's Blues

Stan speaks a different language . I desire to know NMR and math like he does, but I am hopeless. It' s like dreaming to play football like Julio Ricardo Cruz or chess like Michele Godena or the sax like Getz. Generally speaking, when I read a scientific paper, I don't understand what's going on. Sometimes, however, I need to decide, at least, if that paper/poster is important or forgettable. My "trick" is to think like a better. (Actually, every better thinks in his own way...). Now I will show you my "analysis" of the eDispa poster. One very good reason to bet that eDISPA works: the authors, who are friends of mine, wrote privately that eDISPA really works; they have never told a single lie and I trust them. Five reasons to bet against it: (1) The poster says the method is not ready yet. An algorithm, like a principle, either works or not. If it's not ready YET, it means that it doesn't work and never will. I do hope that Stan has discovered AN...

Fear of Learning

Image
Last week I wrote that people generally don't like to learn new software. It must be a tedious job indeed. This week was opened by a small and incredible event that is also an example of opposite attitude. It has nothing to do with NMR, although the main character of the story is reach enough to buy and maintain a couple 900 MHz, privately. Jose Mourinho came in Italy and spoke in public, for the first time, in Italian. He explained that had been studying the new language for only a month, but he spoke so fluently that nobody, here, believes him. If he had learned Latin in 1 year, than I would have really been impressed! FIY, he already spoke Portoguese, Spanish, English and I don't know how many other languages. Isn't it simpler to learn to use a program than to learn so many languages? Of course, but if you could afford to hire the best teachers all for yourself, as Mourinho has certainly done, many things become easy. The expression of Mourinho after having been informed...