Sunday, June 25, 2017

organic chemistry - Reaction of secondary alcohol with ammoniacal silver nitrate (Tollens' reagent)



What are the products of the reaction of 2-butanol with silver nitrate?



For the moment, I am a bit stumped as I only have $\ce{AgNO3}$ as an oxidizing agent to form a carboxylic acid from an aldehyde. Additionally, the lack of $\ce{H2O}$ indicates that this is not the reaction I should be looking for. The only reaction that seems feasible to me is an SN2 mechanism where the nitrate anion acts a nucleophile and the hydroxide ion as the leaving group.



Here is my proposed mechanism much in the style of Tollen's reaction with an aldehyde.


enter image description here




image processing - Feature Detection on a Circular Metal Surface for Character Recognition


Hello I'm trying to recognize characters on the circular metal surface.


Without any preprocessing I could match cropped features with original image. I've actually cropped 2 characters together to increase interested points on a template.


enter image description here


however on different locations of the conveyor belt and with different illumination angle and perspective SURF matching fails.



enter image description here enter image description here enter image description here enter image description here


I will definately crop the ROI from conveyor belt but still I am not sure whether I have to create a database of images to increase accuracy or some kind of preprocessing (I've read that for feature detection there is no require preprocessing on images)


I am open to new suggestions for this problem. Maybe a different algorithm or method that can help me out.


thanks in advance.



Answer



Do not struggle forming a database of images to match via descriptors. This would be too computationally cumbersome and would require immerse amount of training. Such a scalable solution doesn't exist out of the box yet. I would rather rely on Neural Networks or SVMs to train the possible appearances of characters.


Of course using a classifier relies on the assumption that the images appear more or less in a controlled fashion and you can segment the characters. To meet these criteria, you need to stabilize your illumination conditions. You can do this with the appropriate choice of LED lighting. After the illumination is more or less uniform and robust, the character segmentation is straightforward. You can simply threshold the image through local techniques (which posses certain illumination treatment) and apply blob analysis. You can also put all the constraints you have in this stage. Don't forget to unwarp your images prior to segmentation as described in this post.


To train your classifier do not use plain intensity values. This would be very noisy. Instead exploit the gradient information (or normalized gradients). This is proven to be robust in many works such as this one. Also, don't even use the gradients directly. It is better to quantize them (Remember canny?). Robustness of LINEMOD is also a good example of this.


I would suggest further reading on machine vision as this is a practically involved topic. Many techniques on machine vision differ substantially from the methods in computer vision. You can think of this as a practice-theory duality. Refer to this book for instance.


Saturday, June 24, 2017

When should I calculate PSD instead of plain FFT magnitude spectrum?


I have a thirty-second speech signal that was sampled at 44.1 kHz. Now, I would like to show what frequencies the speech has. However, I'm not sure what would be the best way to do that. It seems sometimes one calculates the absolute value of a Fourier transform, and sometimes power spectral density. If I understand correctly, the latter works so that I divide my signal into parts, do FFT part-by-part and somehow sum these. Window functions are somehow involved. Can you clarify this a bit for me? I'm new to DSP.



Answer





Now, I would like to show what frequencies the speech has. However, I'm not sure what would be the best way to do that. It seems sometimes one calculates the absolute value of a Fourier transform, and sometimes power spectral density.



If you want to attach physical meaning to your analysis, then go with the power spectral density, (PSD). This is because this will simply give you the power of your signal, in each frequency band. On the other hand if you do not want/care about a physical meaning, but want to know how the fourier amplitudes of each band vary relative to each other, you can stick to absolute magnitude.


In practice, you can compute the PSD as simply the absolute magnitude of the fourier transform squared. For example, if your signal is $x[n]$, and its DFT is $X(f)$, then the absolute magnitude of the DFT is $|X(f)|$, while the PSD is $|X(f)|^2$.



If I understand correctly, the latter works so that I divide my signal into parts, do FFT part-by-part and somehow sum these. Window functions are somehow involved. Can you clarify this a bit for me? I'm new to DSP.



No, this is not true. What you are talking about here refers to the Short Time Fourier Transform, (STFT). This is simply chopping up your time domain signal, widowing it, and then taking the fourier trnasform. At the end of the day though, you will still have a complex matrix. If you choose to take its absolute magnitude, you will have an absolute magnitude fourier transform matrix. If you take its absolute magnitude squared, you will have a power spectral density matrix.


purim torah in jest - Why do we shake four heretics on Sukkot?



On Sukkot, we shake the Arba Minim. But


ארבע = four


מינים = heretics


Why do we shake four heretics on Sukkot? And furthermore, what heretics are you supposed to shake? Sadducees and Cuthites? This has really been on my mind recently.




Answer



This is in fulfillment of numerous Biblical verses that imply that the wicked will be shaken.



For example, Job (38:12)



לֶאֱחֹז, בְּכַנְפוֹת הָאָרֶץ; וְיִנָּעֲרוּ רְשָׁעִים מִמֶּנָּה


That it might take hold of the ends of the earth, and the wicked be shaken out of it.



Furthermore, Psalms (112:5-6) states that specifically the righteous shall not be shaken; implying that the wicked will be shaken.



טוֹב-אִישׁ, חוֹנֵן וּמַלְוֶה; יְכַלְכֵּל דְּבָרָיו בְּמִשְׁפָּט: כִּי-לְעוֹלָם לֹא-יִמּוֹט


Well is it with the man that dealeth graciously and lendeth, that ordereth his affairs rightfully. For he shall never be shaken. (Trans. Mechon Mamre).




In a similar vein, see Proverbs (10:30).


Additionally, Isaiah (13:13) states that God will shake the heavens and the Earth as punishment:



עַל-כֵּן שָׁמַיִם אַרְגִּיז, וְתִרְעַשׁ הָאָרֶץ מִמְּקוֹמָהּ--בְּעֶבְרַת ה' צְבָאוֹת, וּבְיוֹם חֲרוֹן אַפּוֹ.


Therefore I will make the heavens to tremble, and the earth shall be shaken out of her place, for the wrath of the LORD of hosts, and for the day of His fierce anger.



From context (ibid 9), it appears that these punishments are specifically for the wicked:



וְחַטָּאֶיהָ יַשְׁמִיד מִמֶּנָּה


And to destroy the sinners thereof out of it.




See also Radak thereon.




So we see that we shake the wicked just as God shakes the wicked. However, the question remains, which heretics are considered the wicked who must be punished. It appears that these are the people about whom we are commanded to "lower [to their doom] and not save" (Avodah Zara 26b). This appears to refer particularly to those who betray their fellow Jews to gentile authorities (cf. Hilkhot Hovel UMazik 8:10) and to idolaters and those who sin to anger God (cf. Hilkhot Rotseah 4:14).


equilibrium - Pressure and LeChatelier's Principle


We know that if a system's equilibrium is exposed to a stress, the system shifts to relieve that stress. According to my teacher, certain kinds of pressures are stresses and others are not.


Normally, if we just say that the total pressure of a container with a reaction occuring inside is increased, the reaction shifts toward the side with a small sum of the mole ratios (i.e. $\rm 2A +3B \longleftrightarrow C + D$, if increasing pressure reaction shifts to the right to decrease pressure). I understood this formerly, but another case erases this understanding.



My teacher also said that if we add a noble gas to the container in which this reaction is occurring, although the pressure increases because of a new gas, the equilibrium does not shift to counteract this pressure increase. She says it has to do with the partial pressures of the reactants and products of only the particles In the reaction, but not in the total balloon. But this makes no sense to me because by increasing the total pressure of the system as described before, how does this cause an equilibrial stress and this case doesn't? How does increasing total pressure even cause an equilibrium shift? By increasing total pressure we have a proportional increase in the collision rates of all particles involved, do we not? If this is true, then why wouldn't the reaction rates both be doubled, and hence cause the equilibrium to not shift?


If I'm missing some fundamental principle, please let me know.


Thanks!




halacha - Can a Jewish, non-observant parent cook for his Orthodox child?



Can a Jew who understands the laws of Kashrut but is not personally observant cook for a Kosher-observant Jew? For example, can a Jewish but non-observant parent cook for his Orthodox child?




halacha - How to say Tefilas HaDerech while on the road alone


My question applies to circumstances in which one is driving an extended distance by oneself. They also apply primarily--though not exclusively--to people who do not have the Tefilos HaDerech memorized, or whose minhag is to daven in front of a text at all times (i.e., Chabad).


One is supposed to say Tefilos haDerech while on the road. (Source: http://www.chaburas.org/derech.html). Presumably, attempting to say the prayer while actually driving would be prohibited for reasons of pikuach nefesh and kavana. The other options are to pull over, and say the prayer while stopped on the shoulder (i.e., of the highway), or to leave the highway and say the prayer at a rest stop or somewhere off an exit. However, both these options would seem to have problems. The first (stopping on the shoulder) seems like it could still be quite dangerous, especially for visibility reasons at night, or in bad weather conditions. The second is not always practical, and I am not 100% sure whether it would fall under the halacha of literally being on the road.


So, how, when, and where should one say this prayer?



Answer



If you have a mechanism (such as Bluetooth) for safely talking on a cellphone in your car:


There's a service I once heard of (in the United States) that is provided for precisely this purpose. In short, call 212-DRIVING (+1-212-374-8464) and a man will dictate the Tefillah. He even pauses after each phrase to let you repeat it as he's saying it.


Similarly, you can call a friend and ask him to dictate the Tefillah to you.



Otherwise:


Take the next exit / rest area, pull over, and then say it.



The second is not always practical, and I am not 100% sure whether it would fall under the halacha of literally being on the road.



I'm not sure where you get the halacha that you literally need to be on the road. The tefillah is for travelling. It needs to be said after a certain minimum distance has been traveled outside the city limits, but does not need to be said while actually traveling. As long as you have a certain minimum distance left for the travel, you can still say it.


As for the practicality of it: barring emergencies, I really cannot imagine a highway or road system that does not have stopping areas along the way...


periodic trends - Comparing radii in lithium, beryllium, magnesium, aluminium and sodium ions

Apparently the of last four, $\ce{Mg^2+}$ is closest in radius to $\ce{Li+}$. Is this true, and if so, why would a whole larger shell ($\ce{...