Wednesday, October 31, 2018

organic chemistry - Regioselectivity in electrophilic substitution of pyrrole


In the electrophilic aromatic substitution (EAS) of pyrrole, why is the alpha position preferred over the beta position so much?



Alpha and beta carbons of pyrrole



Answer



The following figure shows the resonance structures we can draw to describe the intermediates produced by electrophilic at the 2- ($\alpha$) or 3- ($\beta$) positions in pyrrole.


enter image description here


image source


You can see that the intermediate produced by attack at the $\alpha$-position can be described by 3 resonance structures. Whereas attack at the $\beta$-position produces an intermediate that can be described by only 2 resonance structures.


Therefore, the intermediate formed by $\alpha$ attack is more stable and the activation energy leading to it will be reduced. Consequently, electrophilic attack at the $\alpha$ position in pyrrole is preferred.


word choice - The different meanings of "life"? 生気/生活/ライフ/生 命/一生/人生/命


I was looking through a dictionary and came across 生活. My original question was




Is this the difference between 生気/生活?


生気 would be like an idea of life. more abstract


生活 would be concrete. So like something/one's life.



My new question is can you help me to understand the different ways "life" is said in Japanese? I actually forgot about 人生 and 命 when I wrote the question. I didn't know about ライフ/生命/一生 (and others?). I think 人生 would usually be when talking about a person's life right?



Answer



生活【せいかつ】 is English life, livelihood, or living; day-to-day activities of people.


命【いのち】 is life; it's something we lose when we die. Synonyms: 生【せい】、生命【せいめい】


生気【せいき】 is more like liveliness, spirit, or energy. Synonyms: 元気【げんき】、活力【かつりょく】



一生【いっしょう】 is a whole life of someone. Synonym: 生涯【しょうがい】


人生【じんせい】 is human's (whole) life; use this only for humans, of course.


ライフ is rarely used unless you're a video gamer. When used, it's the same as 生活 or 命.


Examples:



  • 生活が苦しい difficult to live on (due to financial problems)

  • 生活保護 public assistance

  • 快適な生活 comfortable life

  • 交通事故で命を失う lose one's life in a traffic accident

  • 残り少ない命 little time left to live


  • 命が惜しければ... if you value your life...

  • 生気のない顔 colorless face

  • 声から生気が消える speak in an inanimate voice

  • 生気が戻る become energetic again

  • 一生で一度だけ/人生で一度だけ once in a lifetime

  • 一生の仕事 one's lifework

  • ライフが少ない health is low (in games)


grammar - Topic particle after "expression of time"


I am reading chapter 4 from the JLPT N5 book, where I found the following sentence:



昨日勉強しましたか。




After 昨日, why wasn't there a topic particle? Is "昨日は勉強しましたか。" an incorrect sentence?




shabbat - Is "pikuach nefesh" on shabbos "hutrah" or "dichuya"?


Whenever two mitzvos come into conflict with each other, and one is given precedence over the other (such as in the case of bris milah on Shabbos, or any עשה דוחה לא תעשה (=positive commandment that "pushes away" a negative one)), there is usually discussion over whether it is "הותרא/hutrah" or "דחויה/dichuya," whether the mitzvah that gave way effectively ceases to exist (הותרא), or if it's still there, but we're allowed to override it anyway (דחויא).


We know (Yoma 85a-b, and several other sources) that when someone's life is in danger on Shabbos, and the Shabbos laws have to be violated in order to save his life, that we not only may but must violate Shabbos to save his life. However, it's unclear to me whether this is הותרא or דחויא.


Is פיקוח נפש on Shabbos הותרא or דחויא?


To clarify; I'm looking for sources from the Rishonim and Acharonim that discuss this question.




Answer



This is a rather large dispute among the Rishonim, the early commentaries.


See the Rashba (שו״ת ח"א תרפט):



ולי נראה שהכל תלוי במחלוקת אם נאמר שבת דחויה או נאמר שבת הותרה אצל חולה. אם נאמר שבת הותרה אצל חולה שוחטין לו שלא אסרה תורה מלאכת שבת אצל חולה. ושוחטין לחולה בשבת כדרך ששוחטין אנו לעצמנו... אבל למ"ד דחויה היא מאכילין לו הנבילה שהוא צריך לאכול ואין אנו עוברין לשחוט לו. שבמקום שיש לו בשר לאכול לא נעבור אנו ולא נדחה את השבת. וכמדומה שהלכה כמאן דאמר שבת דחויה היא ולא הותרה. מכל מקום כל שאין שם נבילה אמרינן לגוי לשחוט כיון שהיא דחויה אצלו. ותדע לך שהרי שנינו בברייתא אין עושין דברים הללו לא על ידי גוים ולא על ידי קטנים אלא על ידי גדולי ישראל" (שו"ת ח"א, תרפט)‏


It would seem to be that everything is dependent on whether we say that [melacha] on shabbos is Hutra or Dechuya for a sick person. If we say that it is hutra for the sick, we would slaughter for the sick person as the Torah did not prohibit it for the sick. We would slaughter in the same manner that we slaughter for ourselves. However according to the opinion that it is dechuya, we would feed them a non kosher animal carcass, for he needs to eat, but we would not slaughter for him. in a situation where he has meat available, we do not transgress shabbos. It would appear to me that the Halacha is in accordance with the opinion of Dechuya and not Hutra. Nevertheless, if their is no non kosher meat available we would ask a Gentile to slaughter, for the Shabbos is pushed off for him. And you should know for that which was taught in the Braisa are not done through a Gentile, and not through a minor, rather by an Israelite adult.



The Shulchan Aruch rules:



שולחן ערוך אורח חיים סימן שכח



היה חולה שיש בו סכנה וצריך בשר, (לט) שוחטים לו ואין אומרים: נאכילנו נבילה; אבל אם הי' החולה צריך לאכילה לאלתר, והנבילה מוכנת מיד והשחיט' מתאחרת לו, מאכילין אותו הנבילה


If someone is a Choleh Sheyeish Bo Sakana (a gravely ill person) and he needs meat. We slaughter for him and we do not say "feed him the readily available non kosher meat". However, if the sick must eat right away, and the non-kosher meat is readily available, and if by slaughter the kosher meat the patient would have to wait (Putting him in danger), we feed him the non-kosher meat.



See the Mishna Berurah:



שוחטים לו - הרבה טעמים נאמרו ע"ז י"א משום דשבת הותרה אצל פק"נ ולכן שוחטין לו כדרך ששוחטין ביו"ט ואפילו איסור דרבנן אין מאכילין אותו במקום שאפשר לו לשחוט מטעם זה אבל הרבה ראשונים כתבו דשבת רק דחויה היא אלא הטעם הוא דשמא יהיה קץ באכילת נבילה ולא יאכל ויסתכן ובב"י הביא עוד טעם בשם הר"ן דבנבילה עובר על כל כזית ממנה וחמיר מאיסור לאו דשבת ועוד טעם עי"ש ולפ"ז בודאי מוטב לעבור ולהושיט לו איסור דרבנן משנחלל שבת באיסור סקילה. והנה אם החולה אומר שאין קץ באכילת נבילה ויש נבילה מזומן לפניו אם מותר לשחוט עבורו עיין באחרונים ועכ"פ לענין קטן בודאי נראה דטוב יותר להאכילו בשר נבילה ולא ישחוט אדם עבורו בשבת. כתב בהגמ"ר אם צריך להרתיח יין עבור חולה ימלא ישראל ויחם הא"י ומוטב שיתנסך היין משיתחלל שבת והטעם עיין בד"מ שכתב כיון שאיסור סתם יינם אינו אלא מדרבנן וגם איסורו קל ואין החולה קץ בו לא דמי לנבילה ולכך מוטב שיחם הא"י אם הוא מזומן לפניו שלא ישהא עי"ז וכנ"ל בסי"ב בהג"ה ותו דקי"ל ביו"ד סי' קכ"ה ס"י דא"י המוליך כלי פתוח וישראל משמרו שלא יתנסך שרי א"כ אפשר לחממו ע"י א"י בלי נסוך ומ"מ המיקל בחולה שיש בו סכנה להחם בעצמו אין למחות בידו דיש לו על מי לסמוך עיין בט"ז בסק"ד



The Mishna Berurah says that the it is not clear exactly how we rule as the Shulchan Aruch is vague, since there are 3 possible explanations why to slaughter the animal rather then serve him neveila (prepared non kosher meat):





  1. Shabbos is Hutra for saving a life, so doing an extra melacha is permitted




  2. It disgusts the endangered person to eat treif, so slaughtering is the only means to save his life




  3. It might be better to do 1 issur kareis/sekilla of shechita, rather than let the choleh eat many olive sized portions of neveila that have an issur lo taaseh/malkos for each kezais i.e many smaller sins could outweigh a larger sin.




See the Aruch Hashulchan on this topic as well. He gives a very full treatment to this sugya.



H/t DoubleAA: See too Yechaveh Da'at 4:30 for extensive sources.


See here and here (hebrew) for articles on this topic including sources.


names - Who was Haman's mother?


Is there any mention of Haman's mother in rabbinic literature (Gemara, Midrash, etc.)?


If she was discussed in the Gemara or other sources, what was her name?



Answer



Her name was אמתלאי בת עורבתי.




ואמר רב חנן בר רבא אמר רב אמיה דאברהם אמתלאי בת כרנבו אמיה דהמן אמתלאי בת עורבתי וסימניך טמא טמא טהור טהור



Bava Basra 91a


See also my answer to What was Avraham Avinu's mother's name?


organic chemistry - Is there intramolecular hydrogen bonding in salicylaldehyde?



Is there intramolecular hydrogen bonding between the hydroxyl and carbonyl groups?


Salicylaldehyde


I think personally is that it does but what is concerning me is that I have got no adequate answer or response to my suggestion, so if anyone could help on this one, that would be great.




FIR Filter Design - input parameters conversion


I am new to DSP and filter design. I have developed a code in C++ to calculate FIR coefficients using Parks-McClellan algorithm. The inputs to calculations are:



  1. Filter type (Low-Pass, High-Pass)

  2. Passband Freq [Hz]

  3. Stopband Freq [Hz]

  4. Passband Ripple [dB]

  5. Stopband Attenuation [dB].



I got a new requirement for inputs, namely to use: 1. Cutoff freq (6dB@1.6kHz) 2. Slope [24dB/octave].


Is there a way to convert these inputs into the inputs I used in my C++ code, as listed above?


Or, more general question, how to design FIR filter with custom slope?


Thank you.




Tuesday, October 30, 2018

halacha - Biblical vs. Rabbinical end of Shabbat


This question states, "havdalah ends shabbat (for one who didn't daven ma'ariv)." But won't Shabbat end on its own at some point--specifically, at nightfall--even if we don't make havdalah nor daven maariv?


I understand that melachos might still be rabbinically prohibited until we have made havdalah or maariv, because we are rabbinically required to usher out the Shabbat ourselves. But is it correct that the "Biblical" end of Shabbat--and therefore the end of Biblical prohibitions on melachos--comes automatically at nightfall?




minhag - Yemenite Sefira


What is the source for the custom that Yemenite Jews people count Sefira in Aramaic? and why do they do it?




Answer



Otzar Ta'amei Haminhagim (cf.) explains that it is a remnant of a time when the spoken language was Aramaic. Since the primary purpose of s'fira is the keeping track of days it is preferable to count in a language that enables the counter to keep track - i.e. a language the counter understands.


physical chemistry - Reason for negative Joule Thomson coefficient of Helium and Hydrogen at NTP conditions


Recently, while reading my textbook I came to know that Helium, Hydrogen and Neon are the only gases which have negative Joule Thomson coefficient at NTP conditions, i.e heating effect is observed when these gases expand from a region of high pressure to a region of low pressure. I was wandering about possible explanations for this strange behaviour (since almost all gases display cooling effect during free expansion at NTP conditions) but nothing came to my mind. Can anyone give me a reason why these gases behave differently at room temperature and 1 atm pressure?


One thing I noticed is that all the three gases in question have compressibility factor(Z) always greater than 1, i.e. negligible intermolecular forces of attractions, but how can this explain their abnormal behaviour?



Answer



Note: You can skip section I, and go straight to section II and/or the end of section III (specifically the conclusions subsection), if you are already familiar with the basic mathematical machinery/definitions


I. Preliminaries





Feel free to skip all of this if you are familiar with it


First, we have an adiabatic expansion, i.e $\mathrm{q} = 0 $.


Second, our process is carried out as follows: a gas at pressure $p_i$ flows into a region of lower pressure $p_f$ without significant change in kinetic energy. This is called the Joule–Thomson expansion.


Obviously, this process is inherently irreversible. Additionally, one can show that this expansion isenthalpic (i.e $H_i = H_f$). Unlike a free expansion, work is done, causing a change in internal energy; the exact specifics of this change will depend on the initial and final conditions and also on the nature of the working fluid.


What we measure experimentally is a change in temperature with respect to pressure at constant $H$, and we call it $\mu_{\mathrm{JT}}$ (Joule-Thomson Coefficient).


$$ \mu_{\mathrm{JT}} = \left(\frac{\partial T}{\partial P} \right)_H = \frac{V(T \alpha-1)}{C_p} \tag{1}$$


where $\alpha$ is the coefficient of thermal expansion $$\alpha = \frac{1}{V}\left(\frac{\partial V}{\partial T}\right)_p$$


All real gases have an inversion point at which the value of $\mu _{\mathrm {JT}}$ changes sign. The Joule–Thomson inversion temperature, depends on the pressure of the gas before expansion.


$$\begin{array}{cc} \hline \text{Temperature} & \text{sign of}\ \partial P & \text{sign of}\ \mu _{\mathrm {JT}} & \text{thus sign of}\ \partial T \\ \hline \text{below inversion temp.} & - & + & - \\ \text{above inversion } & - & - & + \\ \hline \end{array}$$


The final pressure is always lower than the initial pressure and thus the change is always negative. Depending on whether you are above or below the inversion temperature, your change in temperature can either be positive (warming) or negative (cooling). I would like to stress that the inversion temperature depends both on the temperature and pressure.





II. Qualitative Analysis


The arguments given below might seem a little "hand-wavy"/crude, but bear with me.


$$ H = U + pV$$ $$ \Delta H = \Delta U + \Delta (pV)$$


During a Joule-Thomson expansion (isenthalpic, adiabatic), the change in $pV$ represents the work done by the fluid.


If $PV$ increases,at constant enthalpy, then U must decrease as a result of the fluid doing work on its surroundings; the working material is using its own internal energy to do work. This produces a decrease in temperature and results in a positive Joule-Thomson coefficient.


Decrease in$pV$ means that work is done on the fluid and the internal energy increases. This can thus lead to an increase in temperature and the Joule-Thomson coefficient will be negative.


For an ideal gas, $pV$ does not change during a Joule-Thomson expansion.


As a result, there is no change in internal energy; also, there no change in temperature; and the joule-thomson coefficient is zero.


In real gases, $pV$ does change. The deviation from ideality (in general) is contained in $Z$, the compressibility factor. Thus, it would make sense if we could make some connection to it.



The ratio of the value of "real" $pV$ to that expected for an ideal gas at the same temperature is called the compressibility factor,


$$Z := \frac{pV}{nRT}$$


For a gas, this is typically less than unity at low temperature (attractive forces dominant) and greater than unity at high temperature.


At low pressure, the value of $Z$ always moves towards unity as a gas expands (tend towards ideality).


In general at low temperature, $Z$ and $PV$ will increase as the gas expands, resulting in a positive Joule-Thomson coefficient.


At high temperature, $Z$ and $pV$ decrease as the gas expands; if the decrease is large enough, the Joule-Thomson coefficient will be negative.


It follows, that for the $Z>1$, Joule-Thomson coefficient will be negative and the gas gets warmer. This is the case for the gases in question at the given conditions.


A graph from wikipedia showing how the Joule-Thomson Coefficient changes sign (for nitrogen):


 Sign of the Joule-Thomson coefficient for N2 as function of temperature and pressure


Note: The question originally asked about gases, but I'll make a small point about condensed phases and supercritical fluids (since you can see them in the graph). At high pressures, these phases can't respond to an increase in pressure by reducing their volume, and $pV$ increases as pressure increases. The molecules are being forced together, and such the Joule-Thomson coefficient is negative.



Of course intermolecular forces, attractive and repulsive, and the limits in which they are dominant are key in explaining the changes of $Z$, and consequently of $\mu_{\mathrm{JT}}$. This point is further developed in the next section.




III. A slightly more quantitative, but ultimately Qualitative Analysis


To see how intermolecular interactions come into play, let's look at two model systems: an ideal gas (no intermolecular interactions) and a Van der Waals gas (both attractive and repulsive interactions).


Using equation (1) and the definition of $\alpha$ we can write


$$ \mu_{\mathrm{JT}} = \frac{V(T \alpha-1)}{C_p} = \frac{T \left(\left(\frac{\partial V}{\partial T}\right)_p -V\right)}{C_p} \tag{2}$$


For a perfect gast $\left(\frac{\partial V}{\partial T}\right)_p = \frac{V}{T}$ and so, $ \mu_{\mathrm{JT}} = 0 $


Since the Van der Waals gas equation is cubic in $V$, I will use the first few terms of the virial expansion and solve for $V$ to obtain $\left(\frac{\partial V}{\partial T}\right)_p$. I am omitting explicit computations, you may do them as an exercise.


$$Z = 1 + \frac{1}{RT} \left(b- \frac{a}{RT} \right)p + .... \tag{3}$$


Since $Z = \frac{p\tilde{V}}{RT}$ where $\tilde{V}$ is the molar volume of the gas; I am doing this for convenience's sake, I don't want to lug around a $n$ all over the place.



$$\tilde{V} = \frac{RT}{p} + \left(b- \frac{a}{RT} \right) + .... \tag{4}$$


After differentiating we obtain


$$\left(\frac{\partial V}{\partial T}\right)_p = \frac{R}{p} + \left(- \frac{a}{RT^2} \right) + .... \tag{5} $$


Substituting (4) and (5) into (2), and dropping all of the higher order terms.


$$ \mu_{\mathrm{JT}} \approx \frac{\frac{2a}{RT}-b}{C_p}$$


Now, consider the low temperature limit of this expression. The $\frac{2a}{RT}$ becomes large, and $b$ is negligibly small compared to it so


$$ \mu_{\mathrm{JT}} \approx \frac{2a}{RTC_p}$$


All the quantities on the right hand side of this equation are positive. so $\mu$ is positive. The attractive forces are dominant, since only the paramter $a$ appears in our expression.


Similarly, the high temperature limit is


$$ \mu_{\mathrm{JT}} \approx \frac{-b}{C_p}$$



Here, $\mu$ is clearly negative. The repulsive forces are dominant, since only the parameter $b$ appears in our expression.


Conclusions



  • The existence of an inversion temperature becomes obvious in a gas with both attractive and repulsive forces, since $ \mu_{\mathrm{JT}}$ changes sign from positive to negative.

  • The connection to attractive and repulsive forces also becomes more explicit.

  • In the low temperature limit, attractive forces are dominant and the gas needs to break free from these interactions as it expands. This requires energy, which has to be supplied by $U$ the internal energy of the gas. Thus the gas cools.

  • At high temperatures, the repulsions are dominant. As the gas expands, the over potential is lowered, and energy is released. Thus, the gas warms up.

  • Obviously, the exact magnitude of the high and low temperature limit depends on the nature of working fluid, since the parameters $a$ and $b$ are different for each gas. The gases you are talking about, have barely an attractive interactions.


Caveats




  • Our analysis based on the Van der Waals gas seems to suggest that the inversion temperature and $\mu_\mathrm{JT}$ is a function determined by temperature alone. This has experimentally proven to be false. This discrepancy arises because we dropped the higher order terms in our expansion which contained the pressure dependance.

  • This model is ultimately qualitative. It will give you the wrong numbers when you try to compute something, but it explains the general trends well.


grammar - Can を used with だ/です


I came across the following passage in a mystery manga. The main character is explaining that the as of yet unknown criminal intentionally made the listener think that Kimisawa was the criminal (though she is not).




おそらく奴は
お前が君沢さんを
犯人だと思い込むのを
計算に入れて


その「香水」の匂いを
かがせたんだ!



"It's likely that that guy (奴) incorporated it into his plans that you'd be under the impression that the criminal was Kimisawa. He made you smell that perfume on purpose!"


Unless I am mistaken, it seems to me that the subject/complement of だ is denoted with を which I thought was unacceptable. Could someone please explain when and if this is allowable?



EDIT: I neglected to mention (didn't notice actually) which を...だ I am uncertain about. I am interested in the お前が君沢さんを犯人だと思い込む part rather than the その「香水」の匂いをかがせたんだ part.



Answer



AをBだ in isolation makes little sense (although there are exceptions). This ~を~だと is a common pattern which appears along with various verbs for assuming, regarding, etc.



  • AをBだと見なす to regard A as B

  • AをBだと考える to consider A B

  • AをBだと仮定する to assume A is B

  • AをBだとする to suppose A as B

  • AをBだと思う to think of A as B

  • AをBだと勘違いする to mistake A as B


  • AをBだと思い込む to make a wrong assumption that A is B

  • AをBだと定義する to define A as B

  • AをBだと受け取る to take A as B

  • AをBだと解釈する to interpret A as B


So Bだと is like as B, and these verbs can take both を and だと at the same time. Sometimes だ is omitted (particularly in casual conversations). 君沢さんを犯人と思い込む (without だ) and 君沢さんが犯人だと思い込む are equally correct.


grammar dikduk - Question regarding ונביא גדול הוא קרוב ממשה רבנו in Rambam's Hilkhos Teshuva


Here is some text from Rambam's Hilkhos Teshuva:



לפי שבאותן הימים תרבה הדעה והחכמה והאמת...מפני שאותו המלך שיעמוד מזרע דויד בעל חכמה יהיה יתר משלמה ונביא גדול הוא קרוב ממשה רבנו ולפיכך ילמד כל העם ויורה אותם דרך ה׳



I checked an early manuscript (p. 32, right page, right column) from the Jewish National University Library and the text as quoted above seems close, except that it omits the pronoun הוא before קרוב:


manuscript


I placed an ellipsis where Rambam proceeds to cite pesukim for his statement. You can see the entire text if you want.


My question concerns the phrase ונביא גדול הוא קרוב ממשה רבנו and Eliyahu Touger's English translation of -קרוב מ as "close to."


It seems to me that "close to" is untenable. Now, I know Rambam isn't writing in biblical Hebrew, but I researched the usage of קרוב in the Tanakh anyway. Whenever it is employed to express the sense of proximity to someone, it is either קרוב אל or -קרוב ל.



Edit: I know the supposed idea is similarity, not necessarily physical proximity. But, one would think Rambam would express both thoughts the same way. That is, moshiach ben David is close to [the prophetic degree] of Moshe, and thus, קרוב אל משה.


קרוב אל: cp. Gen. 45:10; Exo. 12:4; Lev. 21:2-3; Num. 27:11; Deut. 4:7, 13:7, 21:3, 21:6, 22:2, 30:14; 2 Sam. 19:42; 1 Chr. 12:40; Est. 1:14; Eze. 43:19.


-קרוב ל: cp. Ruth 2:20; Ps. 34:18, 85:9, 145:18.


Not only did I not encounter the phrase -קרוב מ used to express proximity or similarity, I didn't encounter it at all. (If someone has encountered it used in that sense, please post the pasuk.)


Here is my question: what grammatical basis is there for translating -קרוב מ as "close to"?



Answer



Because the RaMBa"M spoke Arabic (for those who read Arabic, a closer example is in the first usage example here: "Japan is close to China").


Yes, he wrote in Hebrew, and he was very skilled in his Hebrew grammar. That does not mean, however, that he was not influenced by his Arabic language background. Given that he used this term regularly, I think it is fair to assume that this was his personal writing style, if not the common usage employed by his contemporaries (rabbinic and/or lay Arabic/Hebrew speakers).


Tzarich 'Iyun on that last point, but it is most definitely a grammatically correct expression in the language he used in every day speech and most of his writings.


conjugations - Why do we use 〜ないで instead of 〜なくて before auxiliary ください?


I was taught in college that the 〜ない verb conjugation behaves like an i-adjective, thus it has 〜く form, it takes 〜ければ for "if" scenario, it modifies the noun that follows it etc. Also, I know that the 〜くて form of i-adjective has overlapping roles with 〜て form of verb, such that it can be used to combine the i-adjective or verb with the next predicate, e.g. 滑りやすくて転んだ and 転んで泣いた. However, while 〜て form of verb can be used before auxiliary ください, for verbs that have been conjugated with 〜ない, instead of using the 〜なくて form with ください, we have to use 〜ないで form instead.


I just learned from sawa's answer for my previous question that i-adjective (even with 〜くて form) cannot be followed immediately by ください for the reason that the main verb is missing, but 〜なくて conjugation is attached to a verb so the issue of missing main verb should not be there anymore. Yet, why is it still not 〜なくてください, but is 〜ないでください instead? Where's the missing link in my reasoning? And finally, how does the 〜ないで form match with ください?




classical japanese - Grammar of (verb)し(noun) such as in 選ばれし者



Is there a grammatical explanation for this pattern, which I have seen a couple times in writing? I'm guessing it comes from classical grammar.



Answer



It is from 'classical' grammar, or rather Early Middle Japanese. -し is the 連体形 (the 'attributive' form, used to modify nouns) of the past tense marker -き. It is used to describe events the speaker knows have happened; in contrast to -けり, which is used for events the speaker has only heard about but not experienced himself. (There are a few other past tense or perfect aspect markers - -ぬ, -り, etc - that are older and in varying stages of loss by Middle Japanese.)


選ばれし者 then means 'the chosen one(s), the one(s) who has/have been chosen'.


electrochemistry - Why is chloride oxidised instead of water in copper chloride electrolysis?


For the Electrolysis of Copper Chloride:


Cathode: $\ce{Cu^{2+} + 2e- <=> Cu}$
Anode: $\ce{2Cl <=> Cl2 + 2e- }$



I am confused about the reaction taking place at the anode. Wouldn't $\ce{H2O}$ rather undergo oxidation since it has an increased reducing ability? eg. It is above $\ce{2Cl-}$ on the Table of Standard Reduction Potentials.


Am I missing something? Or do all halogens discharge more readily than water?




halacha - Would a Greek sefer torah be read from in Greek?


If a sefer Torah was written in Greek, would it have been publicly read from in the Greek translation only, or would they also use a Hebrew scroll?




biochemistry - How to add hydrogens to a crystal structure?


PDB protein crystal structures most of the time lack hydrogen atoms. Usually I use PyMOL (h_add) but it does not always seem to be giving the correct result. What can I use for accurate hydrogen addition?



Answer



I've used Reduce before, which is excellent. I'm not sure what you mean by ' does not always seem to be giving the correct result', though? Perhaps you could file a bug report with the PyMOL team if you think there is a bug in h_add.


signal synthesis - Generate loopable sine wave cycle for given frequencies


I am somewhat new to DSP so bare with me. I am working on a simple wavetable oscillator. What I am trying to do is generate one cycle of a wave form for each note (frequency) and store it in an array for later playback. I know I could generate one frequency, store it and resample to the other frequencies in real time but I'm looking for performance and I'm still learning so I'm trying to keep it simple for now.


In my first attempts I was able to generate one cycle of a sine wave at each frequency but when I went to play back the stored wave forms the frequencies were off by 0.5 - 0.10 hz or more and had a noticeable clicking noise when the cycle repeated. I know this is because the start and end of the wave form are not lining up on 0. I've been struggling to solve this problem.


Below is my most recent C# code I use to generate and store the sine wave. This will produce more cycles but seems to fix Hz variance I was getting with just generating one cycle. The only issue that remains is the clicking when it loops back. I may be going about this completely wrong so any suggestions would be greatly appreciated.


double frequency = 440.0; //A4
double sampleRate = 44100;
double numSamples = sampleRate / frequency;

double phase = frequency / sampleRate;

int j = 0;
for (double i = 0.0; i < numSamples; i += phase)
{
double sample = Math.Sin(i * 2 * Math.PI);

sineWaveTable[j] = sample;

j++;

}

I'm not sure if it's even possible to generate a single cycle of a sine wave for each note and have it start and stop on 0. If not, am I stuck with having to use resampleing to get the other desired notes?




Monday, October 29, 2018

halacha - When to light the Shamash when lighting Menorah?


When lighting my Menora, saying the relevant Brachot, and lighting the Shamash, what order should I follow?


I think the best way is: 1. Shamash 2. Brachot 3. Chanukah-Lights


But someone said, the right way is: 1. Brachot 2. Chanukah-Lights 3. Shamash


What do poskim say?



Answer



I think an answer can be inferred from the Aruch Hashulchan's detailed discussion in 673:9-12. He sources the Tur, who says explicitly that there are two non-mitzva lights in addition to the official Chanuka lights. One is a "helper light" called the shamash and the other is an "extra" one.


The shamash is used to light the other light(s). In practice this one must be lit first. As the general principle of saying brachos over la'asiyas mitzvos (i.e. immediately before performance) applies here, I would assume that the b'rachos would be recited in between the shamash and the real lights.


The extra light serves the purpose of ensuring that the increased visibility in the room is attributable to a non-mitzva source and therefore usable. The Tur clearly says that this light is lit after¹ the mitzva light(s) and is not called a shamash.



The two primary transmitters of the Tur's words - Rav Yosef Karo and Rav Moshe Iserles disagree about how to differentiate this light from the others, but it does seem that they conflate it functionally with the shamash, resulting in only one candle. The Aruch Hashulchan concludes by recommending satisfying all aforementioned opinions by using a shamash and then leaving it near to but distinctively from the other light(s).




¹It does appear interestingly that it should be the last one lit so that the official lights are physically grouped together but that designating one of the middle lights as the extra one might not invalidate anything.


word choice - What is the difference in usage between 準備 用意 and 覚悟


The dictionaries translate these three words roughly as preparation/preparedness or ready/readiness.


I don't think I undersand the subtleties of their usage. Not to mention できる also has another meaning as "to be ready" as in 「ご飯できてるよ!」to mean that "The meal is ready."


Please enlighten me. Also ware their any other words commonly used to mean prepare/ready?




halacha - Why Torah Study and Mussar Study are brought in different places in Mishnah Berurah


The Mishnah Berurah 155 in volume 2 discusses which parts of Torah a yeshiva student and a layman should study/ learn:



"ללמוד - חייב אדם ללמוד בכל יום תורה שבכתב שהוא תנ"ך ומשנה וגמרא ופוסקים ובעלי בתים שאינם לומדים רק ג' או ד' שעות ביום לא ילמדו בגמרא לחוד דבזה אינו יוצא אלא צריך שילמוד דוקא גם ספרי פוסקים כל אחד כפי השגתו [שו"ע יו"ד וש"ך שם]: "




In volume 1 it discusses the importance of learning mussar every day:



"וצריך האדם לקבוע לו עת ללמוד ספרי מוסר בכל יום ויום, אם מעט ואם הרבה, כי הגדול מחבירו יצרו גדול הימנו. ותבלין היצר הרע הוא תוכחת מאמרי חז"ל. "



Why does Mishnah Berurah put the emphasis of learning mussar in volume 1 and discuss Torah study in volume 2, rather than discussing learning mussar in volume 2?




marriage - If a woman had more than one husband, to which would she be united at the Resurrection?


Ezra Stiles was a Congregationalist minister in Newport, Rhode Island in the late 18th century. He was a frequent visitor to the Newport Synagogue and there met Rabbi Raphael Hayyim Issac Carregal, a meshulach [fund raiser] from Hebron. In his diary, Stiles relates a question he asked Rabbi Carregal that stumped the good rabbi. After the rabbi agreed that marriage partners would be reunited in the resurrection, Stiles asked whether a woman was married to more than one man, to whom would she be reunited in the Resurrection? Rabbi Carregal (whose name is misspelled at that point in the diary, but spelled correctly elsewhere) replied that there are several opinions, but he did not know the answer. What opinions was he referring to?



Answer



Rav Pe'alim 2 - Sod Yesharim 2 says that she will return to her first husband since before Techiyas Hameisim the Neshama returns to the Neshama of the first spouse therefore it will remain so after Techiyas Hameisim. He further says that the (Guf) body that will get up for Techiyas Hameisim is a new Guf and the previous connection with the second husband will be broken.


Sefer Anaf Yosef - Sanhedrin beginning Perek Chelek says that the death of the first husband is similar to a divorce and the wife will remain with the second husband after Techiyas Hameisim.


inorganic chemistry - Full equation when using vinegar, hydrogen peroxide, and salt to etch copper


What is the full chemical equation when you use the following reactants to etch copper:




  • vinegar / acetic acid (5%) $\ce{CH3COOH (aq)}$

  • hydrogen peroxide (3%) $\ce{H2O2 (aq)}$

  • salt $\ce{NaCl (s)}$

  • copper $\ce{Cu (s)}$


Yes there are previous questions asking the same thing (one and two). However, the answers to both give only parts of the reaction, not the full equation.


Looking elsewhere on the web, I've come across this Instructables article that says copper(II) chloride $\ce{CuCl2}$ is formed when the copper ions bond with chloride ions from the salt. And therefore the solution is greenish in color instead of the blue it would be if copper(II) acetate $\ce{Cu(CH3COO)2}$ was formed as answered in question two. (When doing this at home, I also got a distinctly greenish color when salt was used, and a distinctly blue color when it was omitted).



Table salt, or $\ce{NaCl}$, brings chloride ions $\ce{Cl-}$ to which $\ce{Cu^2+}$ ions will bond to form cupric chloride or $\ce{CuCl2}$ instead of being left in solution (those ions would endlessly come back and forth from $\ce{Cu}$ to $\ce{Cu^2+)}$. You can see this during the reaction (if you leave the reaction with no salt it will turn blue which is the color of copper(II) acetate and stop, whereas if you put salt it will turn green, the color of cupric chloride, and carry on).




Another article on the web says both copper(II) acetate and copper(II) chloride are produced, but no equation is provided:



Equal parts vinegar and peroxide worked fine, dump in plenty of salt (to the point of having undissolved salt in the bottom of jar) since it is consumed in the reaction. You should see a vigorous fizzing at the copper surface. Add more salt as the reaction slows.


The solution will turn green as the copper is converted to copper acetate and/or copper (II) chloride



Can someone please give the complete chemical equation of the reaction that occurs when acetic acid, hydrogen peroxide, and salt are used to etch copper? I can't seem to find it anywhere on the web.




Context:


I want to dispose the products of the etching process safely. If copper(II) acetate is the product as suggested in answer two, then following the recommended approach for disposal is safe:




You can bypass the problem by collecting the etch solution, and submerge aluminum foil.


$$\ce{3Cu(CH3COO)2 (aq) + 2Al (s) -> 2Al(CH3COO)3 (aq) + 3Cu (s)}$$


React with the aluminum until the bluish color disappears, then collect the solid copper + remaining aluminum to throw in the trash. You can now flush the solution down the drain.



However, if the product is instead copper(II) chloride, the approach is not safe as the $\ce{AlCl3}$ formed is considered a hazardous waste and shouldn't be flushed down the drain.


$$\ce{2Al (s) + 3CuCl2 (aq) -> 3Cu (s) + 2AlCl3 (aq)}$$



Answer



The acetic Acid is used to dissolve the copper, however it cannot do so directly as the reaction of copper with protons is not spontaneous.


$$\require{cancel} \ce{Cu_{(s)} + 2H+_{(aq)} \cancel{->} Cu^2+_{(aq)} + H2_{(g)}}$$ The hydrogen peroxide is used to oxidize the copper since copper does not spontaneously react with acids directly. $$\ce{\frac12 H2\color{red}{O2} +e- -> OH-}\\ \ce{Cu_{(s)} -> Cu^2+_{(aq)} + 2e-}$$ However, hydrogen peroxide is unstable in acid so the acetic acid is used because it reacts with hydrogen peroxide to form a peroxyacid which is more stable.



$$\ce{CH3C(O)OH + H2\color{red}{O2} -> CH3C(O)\color{red}{OO}H + H2O}$$


This peroxyacid can react directly with copper to dissolve it.


$$\ce{CH3C(O)\color{red}{OO}H_{(aq)} + Cu_{(s)} -> Cu[CH3C(O)O]OH_{(aq)}} \\ \ce{Cu[CH3C(O)O](OH)_{(aq)} + CH3C(O)OH_{(aq)} -> Cu[CH3C(O)O]2_{(aq)} +H2O}$$


As far as the sodium chloride goes, I'm not sure what that is for. My best guess is that it is catalytic in dissolving the copper similar to how salt corrodes steel


$$\ce{CH3C(O)\color{red}{OO}H_{(aq)} + Cu_{(s)} ->[\text{cat.} Cl-_{(aq)}] Cu[CH3C(O)O]OH_{(aq)}}$$


As far as the final species goes, you probably have a complex from the excess chloride


$$\ce{Cu[AcO]2 (aq) + 2NaCl (aq) -> [Cu(AcO)2Cl2]^2- (aq) + 2Na+ (aq)}$$ which is in dynamic equilibrium $$\ce{[Cu(AcO)2Cl2]^{2-} (aq) <=>[Cl-][AcO-] [Cu(AcO)Cl3]^{2-} (aq) <=>[Cl-][AcO-] [CuCl4]^{2-} (aq)}$$


The color comes from the excess chloride that acts as a ligand to the copper From Wikipedia:



enter image description here

Aqueous solutions of copper(II) chloride. Greenish when high in [$\ce{Cl−}$], more blue when lower in [$\ce{Cl−}$].



physical chemistry - How to obtain product ratio from energy differences via Boltzmann statistics


I am currently calculating some reactions and I would like to express the ratio of the products in per cents. I am using the Boltzmann statistic in the following way:




  1. The probability $p_j$ of a particle $j$ to be in a state with the energy $\varepsilon_j$ is given as $\text{(1a,a')}$. The statement $\text{(1b)}$ must therefore hold, whereas $\text{(1c)}$ also follows. \begin{align} \text{(a)} && p_j &= \frac{N_j}{N}\\ \text{(a')} && \%P_j &= \frac{N_j}{N}\cdot100\%\\ \text{(b)} && 1 &= \sum_j p_j\\ \text{(c)} && N &= \sum_j N_j\\\tag1 \end{align}





  2. For any system with $k$ particles, that are in thermal equilibrium, the probability to find particle $j$ can be expressed via the Boltzmann statistics $(2)$, where $Z$ is the canonical partition function, the inverse temperature is $\beta = (\mathcal{k}_\mathrm{B}\cdot T)^{-1}$ and the degeneracy coefficient is $g_j$. $$p_j=g_j\cdot \frac1Z\cdot \exp\left\{-\beta\varepsilon_j\right\}\tag2$$




  3. I can assume that a state with the energy $\varepsilon_0$ is the ground state, therefore no other state can have lower energy. I can therefore assign the ground state as the baseline and switch to relative energies, as demonstrated in in $(3)$. \begin{align} \text{def.}&& \varepsilon_0 &= 0.0\\ && \varepsilon_j &= \varepsilon_0 + \Delta\varepsilon_j' \\ \therefore && \varepsilon_j &= \Delta\varepsilon_j'\\\tag3 \end{align}




  4. As a consequence I can express the canonical partition function in terms of the ground state probability. \begin{align} && p_0 &= g_0\cdot \frac1Z\cdot \exp\left\{-\beta\varepsilon_0\right\}\\ \therefore && p_0 &= g_0\cdot \frac1Z\\ \equiv && Z &= \frac{g_0}{p_0}\\\tag4 \end{align} The canonical partition function is also defined in $(5)$, but I am quite sure this one would not lead me to my desired goal. $$Z = \sum_l^\infty g_l\cdot\exp\left\{-\beta\varepsilon_l\right\}\tag5$$





  5. I can express any probability in terms of the ground state probability following from $(2-4)$. \begin{align} && p_j &= \frac{g_j}{g_0}\cdot p_0\cdot \exp\left\{-\beta\Delta\varepsilon_j'\right\}\\\tag6 \end{align}




  6. As a last step I will switch to macroscopic numbers, as my quantum chemical calculations give me $\Delta{}G$ values. \begin{align} \text{def.} && \Delta{}G_j &= \mathcal{N}_\mathrm{A}\cdot \Delta\varepsilon_j'\\ && p_j &= \frac{g_j}{g_0}\cdot p_0\cdot \exp\left\{-\frac{\Delta{}G_j}{\mathcal{R}\cdot{}T}\right\}\\\tag7 \end{align}






  • How do I obtain $p_0$ in a way, that I can use it in spreadsheet software like libreOffice calc, so that I satisfy $\text{(1b)}$? If I insert this equation, I would have to solve it iteratively, as I have the variable to solve for on both sides. I could then go ahead and use $Z$ directly. \begin{align} p_0 &= 1 - p_j -\sum_{i\neq0,j} p_i\\ \color{\red}{p_j} &= \frac{g_j}{g_0}\cdot \left(1 - \color{\red}{p_j} -\sum_{i\neq0,j} p_i\right)\cdot \exp\left\{-\frac{\Delta{}G_j}{\mathcal{R}\cdot{}T}\right\}\\ \end{align}


  • Am I making correct assumptions along the way?

  • Could the following work? Assign an arbitrary probability to $p_0$, to obtain an arbitrary value for $[p_j]^\ddagger$. What would be reasonable? I picked $0.25$ as an example. Can I then normalize to get the total percentages? \begin{align} \text{def.} && p_0 &= [p_0]^\ddagger\ =\ 0.25\\ && [p_j]^\ddagger &= \frac{g_j}{g_0}\cdot \color{\green}{0.25}\cdot \exp\left\{-\frac{\Delta{}G_j}{\mathcal{R}\cdot{}T}\right\}\\ \text{Norm.} && \%P_j &= \frac{[p_j]^\ddagger}{\sum_i [p_i]^\ddagger}\cdot 100\% \end{align} This would maybe break down the iterative procedure to a two step process. Is this procedure really equivalent to $\text{(1a')}$?




Closely related: 4 Compounds in Equilibrium with One Another - Determine Their Equilibrium Concentrations




words - what is the name of the abbreviated writing style used in newspapers?



To make articles as short as possible in newspapers, certain conventions are used. One such convention is that when a sentence ends with サ変名詞{へんめいし}、「をする」is omitted. Another is that the full names of companies, such as "三菱重工業株式会社" can be abbreviated as "三菱重工".


I could be wrong, but I am pretty sure that abbreviated writing style has a formal name. What is it?
What are some other conventions?



Answer



As I stated in the comment, the set of "rules" that are used to save space in newspapers and magazines (nowadays, websites as well) is commonly called 「[見出]{みだ}し[文法]{ぶんぽう}」, literally meaning "headline grammar".


Some of the characteristics of 見出し文法 are:


1) Use of [省略語]{しょうりゃくご} (abbreviated words).


2) Omission of all forms of 「する」,「なる」,「いる」 and 「ある」. Instead of 「オバマ[大統領]{だいとうりょう}が[来日]{らいにち}する(or した)= "President Obama visits/visited Japan."」, you will see a 「オバマ大統領来日」 as the headline.


3) Omission of particles -- most importantly, that of 「」 and 「」. I say "most importantly" because, as many of you would know, particles in general often get omitted in informal conversations, but が and を are the ones that are least often omitted. For this reason, the omission of those two in 見出し文法 is of significance.


You will see a 「俳優田中明警官刺し逃走」with just a single kana instead of a 「[俳優]{はいゆう}田中明{たなかあきら}が[警官]{けいかん}を[刺]{さ}して[逃走]{とうそう}している」= "Actor Akira Tanaka stabs policeman and runs away."



4) Omission of the predictable verb following the object of the phrase. For instance, if a native speaker saw the short phrase 羽生「金」, he will be able to tell that it is the 見出し form of the sentence 「[羽生]{はにゅう}が[金]{きん}メダルを[獲得]{かくとく}した」 = "Hanyuu won the gold medal."


***Please note that only #1 above is used in BOTH headlines and articles. The other techniques are used only in headlines.


passover - tap water on Pesach


The New Croton Reservoir supplies much of New York City's tap water, and people are allowed to — and do — go out on boats and fish. I'd venture a guess that almost every Saturday and Sunday, a piece of bread falls into the water.



I don't know how long it takes for the water to reach New York, but strongly suspect that the water at the tap in New York is connected by water to the reservoir. (This last suspicion is amplified by the fact that the water travels to New York under gravity alone. For it to do so implies that there's no "break" in the water: any break would be filled by the water propelled by gravity.)


Even a small amount of chametz that gets mixed into water on Pesach makes the water chametz.


I know some New Yorkers do not drink (or cook with) water that comes from the tap on Pesach, but most are not so stringent. Why aren't they? What heter is there to use the water? (Sources, please, if possible.)



Answer



Hacham Ovadia Yosef discusses this issue in Yabia Omer Helek 7 Siman 44 in terms of the kinneret, which supplies water for most of israel. Kibbutzim along the coast are KNOWN for dumping hametz into the water. He answers that hametz dumped before pesach is nullified in 60. During pesach, he applies the concept of "tzonen bitzonen". Since the hametz and water were both cold (I.e. They weren't cooked together) the flavor of the chametz doesn't spread to all the water, and as long as you're not drinking ACTUAL hametz, there's no problem with the water. He concludes by saying that it's best to use pre-filtered water, but if not, the water is not assur.


Sunday, October 28, 2018

synagogue - Auctioning/Sale of Kibbudim on Shabbat / Yom Tov


Many synagogues have the practice of selling kibbudim (i.e. aliyot, haftorah, opening the ark, etc.) on major holidays, usually via auction. I've been to some shuls where this is done every Shabbat.


A related practice is "pledge drives", where after the Rabbi's speech on a major holiday, the floor is open for people to pledge donations to the shul.


How is this allowed on Shabbat and holidays? Isn't this essentially masah umatan or at least too closely related to matters of money or business?



Answer




The Gemara (Shabbos 150a) points out that we are restricted on Shabbos ממצוא חפצך, from looking after our personal business affairs - but that this implies that חפצי שמים מותרין, Divine business affairs are okay.


Based on this, it lists several categories of things that are permitted on Shabbos under this heading, one of which is פוסקין צדקה לעניים - making assessments of tzedakah for the needy. (Some of the other things listed there are familiar from the Shabbos zemer Mah Yedidus.)


This is codified in Shulchan Aruch, Orach Chaim 306:6. Rema there writes that "some say that in places where it is customary to recite a Mi Shebeirach for one who reads from the Torah, and he makes a pledge for tzedakah or for the chazzan, that it is prohibited on Shabbos to spell out how much he intends to give; but the custom is to be lenient, since it is permitted לפסוק צדקה."


Mishnah Berurah there (:27) explains that this can't be considered buying and selling (מקח וממכר), since nothing is actually changing hands. Further on (:33) he adds that there is a dispute whether it is permitted to "sell" mitzvos on Shabbos, with some authorities forbidding it and others saying it's fine because no actual object is being bought, "so in places where they are customarily lenient on this, one should not object against them."


pronunciation - Repeating the vowel sound of the mora that precedes gemination in songs


I noticed that in songs, the vowel sounds of the morae that come before geminations are sometimes repeated.


For example, the first lyric line of “マジカルちょーだいっ” is sung as しらんぷりをしたあって where the line is actually しらんぷりをしたって.



Another example: in the second lyric line of “片道きゃっちぼーる”, the final あった sounds like ああった.


Also, at the beginning of the song “Gem Stone”, the repeated もってる is pronounced as もおってる.


My questions are:




  1. Is this way of pronouncing gemination limited to songs, or are there instances where it's used elsewhere?




  2. It seems to be limited to songs with children or children-like voices, so is it by chance the way Japanese children initially pronounce gemination?






Answer



It is common in songs, and it is not specific to children’s songs.


In the first case, the pitch of the lyric line is probably something like:



し(G) ら(G) ん(G) ぷ(G) り(G) を(F#) し(G) た(E) っ(F#) て(D)



but if you try to sing this as it is, there is a problem: gemination is not a sound but just a pause, and you cannot sing it with any pitch. Therefore, the vowel preceding the gemination is prolonged to fill the first part of the mora which should filled by the gemination:



し(G) ら(G) ん(G) ぷ(G) り(G) を(F#) し(G) た(E) ーっ(F#) て(D)




I did not check the other two videos, but I guess that they arose for the same reason.


minhag - Hand movements when lighting shabbat candles


When women light shabbat candles I often see them making hand gestures. These look like two or perhaps three circles around in the air. What is the source for this practice? Is it a law or custom? Is the candle lighting kosher without the gestures?




usage - Difference between 「 ただ」, 「たった」, 「ただ ~だけ」, and 「ただし」



I translate these words as either "only, just, simply".


I'd like to know how I could differentiate these 4 ways (i.e., when I use that one, and when I use the other).


Examples:




  • たったひとつの恋 (Dorama)

  • ただの子供だ

  • ただ待つだけだ

  • よし, この 10 万円は君にあげよう. ただし, これ以上はお断わりだよ.
    ...

    ... so on





halacha - Can an Orthodox frum woman who keeps tziniut ride a motorcycle?


Can an Orthodox frum woman who keeps tziniut ride a motorcycle? If yes, then what type of clothes should she wear to keep her tzniut (knees covered with skirt).




frequency spectrum - Fourier transform of a Fourier transform


I generate a Gaussian noise and then I filter it with a passband FIR Kaiser window filter. When I perform the Fourier transform of the output of the filter and plot its magnitude spectrum, it is filtered in the correct frequency band. Now, I perform a second Fourier transform on the output of the first Fourier transform (I'm performing it on a complex vector this time and in the frequency domain), and when I plot the magnitude spectrum I see something very similar to the original filtered noise. I know this isn't time domain, I know this spectrum is not even because the input signal is complex. But as the time plot of the filtered noise and the absolute value plot of the Fourier transform (of the Fourier transform of the noise) are visually similar a doubt arised on me.



  1. Why is the amplitude spectrum of the complex vector obtained after performing a Fourier tranform on the filtered noise once again occupying the whole vector (the whole frequency band) as if they were time samples spread in the time vector?

  2. Is the negative symbol in the inverse Fourier transform of the Fourier transform of the noise having no effect so that it is visually similar performing a Fourier transform of Fourier transform of noise and performing an inverse Fourier transform of Fourier transform of noise?


This doubt arised to me when I was trying to filter on a matched filter implemented in Matlab using IFFT(FFT(signal_1).*FFT(signal_1_inverted)) and I accidentally filtered the output of an already Fourier transformed signal and coudn't notice the difference (not on the output of the filter but on the output of the first FFT stage). And this leads me to another question.




  1. Suppose I would like to detect the likelihood of 2 signals by comparing their spectrums and I want to measure the likelihood by using a matched filter. Knowing that the convolution in time is the multiplication in frequency, is the convolution in frequency the multiplication in time and I get the same result if I use a matched filter (sort of convolution operation) on the spectrums than if I perform a sample by sample multiplication in time domain of the signals whose spectrums likelihood I want to determine?



Answer



I don't know what you've done wrong but applying the Discrete Fourier Transform (via FFT) twice to a time domain signal, should produce the original time domain signal in a circularly time reversed and linearly scaled by N form, as the Inverse Discrete Fourier transform is very similar to Forward Discrete Fourier transform except in a simple weight by N and the sign of the complex exponential, which reflects itself in the time reversal of the original signal...which is known as the Duality Property of DFT


Looking at the Inverse Discrete Fourier Transform of $X[k]$ we see: $$ x[n] = \frac {1}{N} \sum_{k=0}^{N-1} {X[k]e^{j \frac{2\pi}{N} k n}}$$


and by just changing the sign of the exponent $e^{j \frac{2\pi}{N} k n}$ into negative by a change in the sign of the $n$ of $x[n]$ what you get is:


$$ N x[(-n)_N] = \sum_{k=0}^{N-1} {X[k]e^{-j \frac{2\pi}{N} k n}} $$


which is N times the circularly reversed (obtained via modulus operator denoted by $(.)_N$) version of the original signal $x[n]$ that is obtained by an apparently forward but effectively inverse Discrete Fourier Transform applied to $X[k]$ treated as a time sequence, which is what you do at your second stage of applying forward FFT to $X[k]$ of $x[n]$


Saturday, October 27, 2018

aqueous solution - Why do some solid chemicals dissolve better in colder water?


I just discovered that some solid chemicals, such as $\ce{Na2SO4}$, dissolve better in cold water than hot water from here and would like to know if there is any particular reason as to why. Is it their structure, their charge, etc.?



Answer



As with every process, dissolving can be described by the thermodynamical equation:


$$\Delta G = \Delta H - T \Delta S$$


Which the process being spontaneous if $\Delta G$ is negative.


We have two components here, enthalpic and entropic. The enthalpic component $\Delta H$ is a constant of the salt in question. The entropic component $\Delta S$ can usually be considered positive because a highly ordered crystal lattice is broken to give dissolved, much less ordered fragments — hence why for most salts they dissolve easier in hot water.



If the solubility decreases with higher temperatures, then $\Delta S$ must be negative. The salt will then only dissolve if $\Delta H$ is negative enough to give an overall negative result. This seems to be the case for $\ce{Na2SO4}$


It is impossible to predict $\Delta S$ and $\Delta H$ a priori without any computer quantum calculations. One has to resort to experiments to determine whether a salt will dissolve better or worse in the heat.




While I have used the term ‘salt’ most of the time, the same is true for molecules. Take sucrose: I was asked in a physical chemistry lab to guess with my colleague whether sugar would dissolve endothermicly or exothermicly. We decided, that the degree of order be a lot higher in dissolved sugar due to a high amount of water surrounding it rather tightly, that the entropy must decrease, so that the enthalpy has to be negative and sugar has to dissolve exothermically. Hence sugar should dissolve more easily in cold water, too.


According to a comment by Nicolau Saker Neto, our reasoning was false and sucrose displays increasing solubility at higher temperatures. Apparantly the testing faculty member approved of it, though.


children parenting - Are there unforgiveable sins?


If parents have committed atrocious sins against their children such as incest, physical abuse, drugging, etc. is it considered an unforgiveable sin?




fft - About Discrete Fourier Transform vs. Discrete Fourier Series


I am new to the field of signal processing. I am wondering what is the difference between DFS(Fourier Series) vs. DFT(Fourier Transform).


For common applications, usually we get a segment(length N) of digital waveform(like a audio segment), and then we apply FFT(DFT) and then do post-analysis with it.


I am wondering if we can use DFS(thus not using DFT at all) all the time and just assume the waveform segment is repeated with period N. Would this naive thinking/approach cause any problems?



Answer



There is no operational difference between what is commonly called the Discrete Fourier Series (DFS) and the Discrete Fourier Transform (DFT). On the USENET newsgroup comp.dsp, we have had fights about this topic multiple times (if Google Groups wasn't so badly broken and messed up, I might be able to point you to the threads) and, despite the deniers, there is no, none whatsoever, operational difference between what is sometimes labeled as the DFS but most commonly labeled as the DFT. (The "FFT" is essentially an efficient or fast method of calculating the DFT.)


halacha - Should I improvise a b'racha in a case of doubt?


I didn't grow up on "b'racha bees" and I know there's a lot I don't know, so I sometimes find myself in a situation where either I know there's a b'racha for something but I don't know it, or I don't know if there's a b'racha but it feels like there ought to be. Let's assume that I need to answer the question "in the moment" and can't wait to go consult a source first (thus, I'm not asking about food, which I can wait to eat, but about other kinds of b'rachot).


In that case, per the halacha should I:




  • Improvise something and use the b'racha formula, because it's better to thank HKBH properly than improperly?




  • Improvise something but not use the b'racha formula, to avoid a b'racha l'vateilah?





  • Say nothing but think thankful thoughts?




  • Something else?




And are the two cases different -- knowing the situation calls for a b'racha (but I don't know what it is), versus not knowing if the situation calls for a b'racha?


I will benefit most from sources I can read in English.



This question was prompted by this one.



Answer



Rambam Laws of Brachot 1:5



The text of all the blessings was ordained by Ezra and his court. It is not fit to alter it, to add to it, or to detract from it. Whoever alters the text of a blessing from that ordained by the Sages is making an error.



So "Improvise something and use the b'racha formula" seems to be out.


If you know the situation mandates a bracha and you know the proper text of the bracha but you don't know if in this particular situation you should make a bracha (i.e. you bump into the Prince of Liechtenstein and you don't know if you should say the bracha of seeing a king over him, so you know there is a bracha on seeing kings you just don't know if it applies to a prince) there seems to be a wide range of opinions with the suggested opinion being to say the bracha outloud but say the shemos mentally (warning machlokes alert !) Laws of Brachos - Binyamin Furst


If you don't know if a bracha should be made at all i.e (you are aboout o give charity and you don't know if there is a bracha to make - hint there's not !) I cant see why you can't thank hashem mentally or say words of praise.


In terms of your last question:




Mishna Brurah 202:84 quoting Gemara Brachot 35a writes that if one hasn't learned the halachot of Brachot one shouldn't just make Shehakol on a food one doesn't know the bracha for. Similarly, the Kitzur S"A 50:2 writes that it is appropriate to make Shehakol if one can't figure out what type of food it is or if it is a food about which there is an unresolved dispute in the poskim.



The laws of Brachot are very complex and it's not always possible to answer every nuance of the question so I suggest you read Rabbi Furst's book linked above.


I can't say I am 100% satisfied with the thoroughness of this answer so if you ask constructive questions I will try to get them answered or if you think the post should be removed I would also understand that.


parshanut torah comment - Why is the birth of twins a Chidush for Rivka?


Background:
In Parshat Toldot, Rivka conceives and is troubled by the discomfort.
She goes to ask Hashem and it is explained to her that 2 nations are struggling within her, so she already knows that she is birth multiples.
But in pasuk 24, the text reads, " וְהִנֵּה תוֹמִם בְּבִטְנָהּ" "and behold, there were twins in her womb" (text and translation God via Chabad, bold, mine).


Question:
If she knew that there was more than one child, why was it a surprise that 2 were born?

The Rashbam says that the use of "hineh" is reserved for a "chidush" -- something that was not known before, and he gives 2 examples.
How was this a surprise?


The Sforno says that before they were born, it was known that there were 2 babies.
Was she expecting one baby to kill the other in the womb?


My first thought was that the prophecy regarding 2 nations was metaphorical -- that a single child would struggle with his nature so the birth of two separate babies was unexpected.
But if that were the case, why would pasuk 22 state, "וַיִּתְרֹצֲצוּ הַבָּנִים בְּקִרְבָּהּ" and say explicitly that there was more than one child in there (and why would the Sforno endorse the idea that this was known)?
Is it that the pasuk tells us but she doesn't know?
If so, why tell us at all if the text is going to use the language of "behold"?




Japanese don't learn kanji meaning only readings? Does it make sense for a kanji to have a key meaning to identify it?


As I understand it works like this. By the time Japanese kids enter first grade they have more or less decent vocabulary of words they know. So when kanjis are taught I can't even imagine how to tell in Japanese that, for example, 女 means "woman"(おんな) and has a kun-reading おんな, since meaning and reading is the same word. 「女」漢字は意味が「おんな」です。くん読みが「おんな」だ。Something like this? It looks like only readings are taught and kids kind of figure out the key meaning on their own, based on the vocabulary they possess.



Note that I'm self-taught in Japanese and though I use JLPT N3 materials, I can mess up in basic things.


Another example. When person wants to explain using what kanji to write his/her name how do they explain that? How to identify exact kanji if one reading links to numerous characters?


In English I rely a lot on using key meaning to identify the kanji, but what exact wording do I use in Japanese?


Hope you can help me out. Thanks.



Answer



To answer your second question --
When I'm talking on the phone and want to say how to write someone's name or address in kanji, I often say like:




  1. 「[京子]{きょうこ}」の「きょう」は、「[京都]{きょうと}」の「[京]{きょう}」です。


  2. 「[明日香]{あすか}」の「あす」は、「[明日]{あした}」で、「[香]{か}」は、「[香]{かおり}」です。

  3. 「[聡]{さとし}」は、[耳偏]{みみへん}に「[公園]{こうえん}」の「[公]{こう}」と「[心]{こころ}」です。(or 「[聡明]{そうめい}」の「[聡]{そう}」です。)

  4. 「[本陣町]{ほんじんちょう}」は、「ブック」の「[本]{ほん}」と、こざと[偏]{へん}に「[車]{くるま}」(or 「[陣内孝則]{じんないたかのり}さん」の「[陣]{じん}」)で、「[町]{まち}」です。



translation - What is the meaning of 商{あきな}いせず?


What is the meaning of 商{あきな}いせず? It is common to use the stem verb plus せず instead of the negative form of the verb plus ず?



持ち込んだ荷物を商{あきな}いせず




Answer




「[持]{も}ち[込]{こ}んだ[荷物]{にもつ}を[​商]{あきな}​いせず」




「商い」 means "business", "vending", etc.


「せず」=「しない」 in meaning.


「商いせず」, therefore, means "not selling", "not trading", etc.


The whole phrase, thus, means "(Someone is) not selling the stuff that he has brought in."


bugs - Can a non-Jew eat living ants?


My pizza has some ants in it. I thought, who cares. Just eat them alive.


Does that break Noahide laws?


Must all of our food must be really sterile (i.e., dead)?



Answer



The Mishneh Torah rules:




The prohibition applies to a limb or flesh that is separated from either a domesticated animal or a beast. However, it appears to me that a gentile is not executed for eating a limb taken from a living bird. ( Melachim uMilchamot 9:11)



Though the Rava'ad (see Moznaim ibid) disagrees, he exempts a sheretz (creeping creature), and it is would seem seafood is just out of the equation.


It would seem then that the prohibition would not extend to insects or similar creatures.


organic chemistry - Why is methanol toxic?


There are two points of view for the answer of this question:



  • The biological view, the only one that I faced during my research, states that since it can trigger perilous conditions like metabolic acidosis, cause a neurologic sequelae, etc. methanol is toxic.

  • The chemical point of view in an answer, which is the one I seek, is the reactions that occur in the body with methanol as a reactant.


Why should it be a reaction? Because I assume something will be toxic for humans when it reacts and disables some of their bodies' vital compounds; e.g.: Hydrogen cyanide reacts with enzymes, renders their active sites useless, and finally causes heavy reduction in bio-chemical reactions that results in quick death.


So, the question is: What reactions use methanol in the body that makes it toxic for us?



Answer




Methanol isn't particularly toxic in and of itself, although it's no walk in the park.


If methanol flowed through the body without being broken down, it would cause roughly the same kind of harm as ethanol, i.e. intoxication.


The real culprit is one of its metabolic products, methanoic acid, also known as formic acid.


To understand how formic acid, present as the formate ion, is toxic, we look to Wikipedia:



Formate is toxic because it inhibits mitochondrial cytochrome c oxidase, causing the symptoms of hypoxia at the cellular level, and also causing metabolic acidosis, among a variety of other metabolic disturbances.



Edit: As DavePhD points out, an intermediate product in this process is formaldehyde, or methanal. While formaldehyde is also toxic, it is rapidly metabolized to methanoic acid.


Reedit: The deeper, more historical reason that this happens is that methanol isn't readily available in nature, meaning that few species have developed biochemical tools to deal with it. There simply hasn't existed an evolutionary pressure to deal with methanol.


minhag - Why do we open the ark for important prayers?


What is the origin of the custom of opening the ark for important prayers (not connected with the need to take out the Torah scroll)?




Answer



Levush Orach Chaim 133 says that this is done to help us have the proper intention by Tefila.


Rivivos Efraim Volume 3:395 says that the reason we open the Aron Kodesh has to do with the Posuk "Vataal Shaavosom El HoElokim ותעל שועתם אל האלקים" which is said regarding the place the Sefer Torah rests upon, and the proof is that we open it up for Shema Kolainu to inspire the Zechus of the Sefer Torah.


Friday, October 26, 2018

organic chemistry - Why is the nitroso group a deactivating group for electrophilic aromatic substitution?



Does the lone pair of nitrogen in nitrosobenzene take part in resonance? If not, then why? If it takes part in resonance then the hybridisation of nitrogen is sp. Can a sp hybridised atom be attached to the ring?




organic chemistry - How to rationalise the protonation state of amino acids


I am learning about amino acids in various $\ce{pH}$ environments and how their groups are protonated or deprotonated in these environments. I don't need to mention a specific acid for my question, I will just use the generic form of one: $$\ce{H2N-CH(R)-COOH}$$


The $\ce{H2N}$ group has a $\mathrm{p}K_a$ of $8$, I believe, and the acid has a $\mathrm{p}K_a$ of $3.1$.


If I drop these into a solution with $\ce{pH} = 12$, the $\ce{COOH}$ will donate it's hydrogen ion, but the $\ce{H2N}$ will not. It will only add another hydrogen ion if it is basic compared to the solution to become $\ce{H3N+}$. Why is it, that it won't donate its hydrogen ion like $\ce{COOH}$, when it is acidic compared to the solution, to become $\ce{HN-}$?




history - What is meant by "synagogue" in the Temple in Sota 7.8?


THe Mishna (Sotah 7.8) describes the order of transferring a Torah scroll to the King for reading on Hakhel:



חַזַּן הַכְּנֶסֶת נוֹטֵל סֵפֶר תּוֹרָה וְנוֹתְנָהּ לְרֹאשׁ הַכְּנֶסֶת, וְרֹאשׁ הַכְּנֶסֶת נוֹתְנָהּ לַסְּגָן, וְהַסְּגָן נוֹתְנָהּ לְכֹהֵן גָּדוֹל, וְכֹהֵן גָּדוֹל נוֹתְנָהּ לַמֶּלֶךְ, וְהַמֶּלֶךְ עוֹמֵד וּמְקַבֵּל וְקוֹרֵא יוֹשֵׁב.


The synagogue attendant takes a Torah scroll and hands it to the head of the synagogue, the head of the synagogue hands it to the deputy and he hands it to the high priest, and the high priest hands it to the king and the king stands and receives it, but reads it while sitting.




What is meant here by "synagogue" and who are חזן, ראש הכנסת וסגן?




grammar - Can we optionally include (or exclude) an を particle in between the noun of the する-verb and the する itself?


When we have a する verb (e.g. 支{し}度{たく}する、案{あん}内{ない}する、心{しん}配{ぱい}する), is it true that we could optionally insert an を particle in between the noun and the する?


Because in the example sentences here and here, we can see this usage (the usage of を particle appearing between the noun and the する).


So basically am I right to say that for all する verbs, we can optionally include (or exclude) an を particle in between the noun and the する?


If not, how exactly should we decide whether or not to include that を? I mean I know with a lot of usage we will just know it, but are there any rules that we can apply here?



Answer



Here are the only two exceptions I can think of where you absolutely can't insert "を":


If the construction wasn't based on をする but とする like さっぱりする→◯さっぱりとする ☓さっぱりをする


If the construction is "merged" single character する verbs like 動{どう}じる/動ずる、案{あん}じる/案ずる、命{めい}じる/命ずる、失{しっ}する、課{か}する、罰{ばっ}する etc.



However, it's uncommon to just add を in in many cases - so the result may be awkward if it's without precedent. Basically, adding an を adds emphasis on the noun the verb comes from, rather than the action that する notes. Think of 支度をする and 支度する as "to do preparations" vs. "to prepare" - either sound fine, but 誘{ゆう}拐{かい}をする and T "to do(?) a kidnapping" vs. "to kidnap" It's not exactly like that, but I guess I'm trying to show how some cases like with 誘拐 it would sound awkward.


Also something to note is that if you're adding a "を" for instance with 掃{そう}除{じ}をする. You can't add another "を". 部屋を掃除をする you would write it as 部屋の掃除をする - however this isn't a problem if you've omitted the を. For instance with 子どもを誘拐する. Again, 子どもの誘拐をする would be grammatically "correct" but would sound extremely "off".


Is a leaky integrator the same thing as a low pass filter?


The equation governing a leaky integrator (according to Wikipedia at least) is


$\frac{d\mathcal{O}}{dt} + A\mathcal{O}(t) = \mathcal{I}(t)$.


Is a continuous-time leaky integrator thus the same thing as a low pass filter with time-constant $A$, up to some scaling of the input?



Answer



A so-called leaky integrator is a first-order filter with feedback. Let's find its transfer function, assuming that the input is $x(t)$ and the output $y(t)$:


$$ \frac{dy(t)}{dt} + Ay(t) = x(t) $$


$$ \mathcal{L}\left\{\frac{dy(t)}{dt} + Ay(t)\right\} = \mathcal{L}\left\{x(t)\right\} $$


where $\mathcal{L}$ denotes application of the Laplace transform. Moving forward:


$$ sY(s) + AY(s) = X(s) $$



$$ H(s) = \frac{Y(s)}{X(s)} = \frac{1}{s + A} $$


(taking advantage of the Laplace transform's property that $\frac{dy(t)}{dt} \Leftrightarrow sY(s)$, assuming that $y(0) = 0$).


This system, with transfer function $H(s)$, has a single pole at $s = -A$. Remember that its frequency response at frequency $\omega$ can be found by letting $s=j\omega$:


$$ H(j\omega) = \frac{1}{j\omega + A} $$


To get a rough view of this response, first let $\omega \to 0$:


$$ \lim_{\omega \to 0} H(\omega) = \frac{1}{A} $$


So the system's DC gain is inversely proportional to the feedback factor $A$. Next, let $w \to \infty$:


$$ \lim_{\omega \to \infty} H(\omega) = 0 $$


The system's frequency response therefore goes to zero for high frequencies. This follows the rough prototype of a lowpass filter. To answer your other question with respect to its time constant, it's worth checking out the system's time-domain response. Its impulse response can be found by inverse-transforming the transfer function:


$$ H(s) = \frac{1}{s+A} \Leftrightarrow e^{-At}u(t) = h(t) $$



where $u(t)$ is the Heaviside step function. This is a very common transform that can often be found in tables of Laplace transforms. This impulse response is an exponential decay function, which is usually written in the following format:


$$ h(t) = e^{-\frac{t}{\tau}}u(t) $$


where $\tau$ is defined to be the function's time constant. So, in your example, the system's time constant is $\tau = \frac{1}{A}$.


matlab - Frequency vector and fft


I have got a question concerning the definition of the frequency vector for an fft operation.


Generally, I work with a frequency vector, f, with power of 2 elements (2048, 4096, 8192, ...).



Given a certain simulation analysis time, time (e.g. 600s), I should define f as follows:


% Frequency defition
t = 0:dt:(time-dt);
df = 1/(time);
fn = Nfft/time;

$$ f = -f_{n}/2:df:f_{n}/2-1; $$


where $ f_{n} $ represent the Nyquist cut-off frequency.


Actually, for:




  • computational reasons

  • symmetry of the power spectra along f axis

  • not throwing away real or imag part of the fft


I aim to define only half of the frequency range, as for example


$$ f = 0:df:f_{n}/2-1; $$


After calling the fft of my input signal, I would get the desired time series as


ouput = [real(fft) imag(fft)];

But, this way, I count the 0 frequency term twice and the -fn/2 is completely discarded.



How would it be possible to emcompasses the whole standard frequency range starting from only half of it?



Answer



The proper way to define your frequency vector after a DFT is as follows. Let $N$ be your DFT length, and $f_s$ be your sampling rate in Hz. Furthermore, define an $N$-length frequency vector $\bf{f}$, where each element $f_i = i$, for $i = 0, 1, 2, ... N-1$.


Now your frequency vector in hertz is simply going to be $\bf{f}$$\frac{f_s}{N}$


Now, assuming you are DFT'ing a real sequence, simply pick all elements with frequency values less than $\frac{f_s}{2}$, and you are in business!


You can also see my answer here for actual code.


halacha - Reading a newspaper


Are there any works that discuss the permissibility of reading secular newspapers on a weekday? The Ketzos HaShulchan (Badei HaShulchan 107:43) holds that it's forbidden:



Other [i.e. not Torah] newspapers in our generation are pretty much all against G-d and His anointed and are full of dirty jokes, heresy, and atheism, unfortunately, and even on a weekday it is forbidden to read them. Even if someone only wants to read the news part brought in the newspapers, it's still forbidden, lest he continue to read the other bad parts ... [Someone who reads them] transgresses "Don't turn to the idols" and strengthens his yetzer hara against himself ... Many people stumble in this area because they don't impart to themselves the enormity of the prohibition; someone who cares about his soul should distance himself from them, because these newspapers have made many dead fall.



Shmiras Shabbas KeHilchasah (second edition, ch. 21 note 117) quotes this source and doesn't bring a dissenting view.


The practice seems to be to read newspapers. I was wondering if there was a discussion of this in the modern poskim. (It's said that the Netziv would read the newspaper on Shabbas, but his position isn't clear — we don't know his exact reasoning. I'm looking for modern poskim who specifically speak about the issue and aren't just quoted as having read it or say it as a side point so I can see their reasons, etc.)


It was also asked about Reading a newspaper on Shabbat, but this is dealing with weekdays.




halacha - What is the point of a hechsher on Cholov Stam?


I assume that the widespread custom of eating/drinking Cholov Stam products (products using milk in which the milking was not observed by a Jew) is relying on the leniency of R' Moshe Feinstein that the government supervision and FDA oversight is enough to assume the kosher status of the milk. If so, why are there some brands of milk that have a hechsher, which is not a Cholov Yisroel hechsher? If you aren't being stringent for Cholov Yisroel and the hechsher is not accomplishing that, what is the purpose of the hechsher?



If the answer is that there is no purpose, is it dishonest of Kashrus agencies to take money for a useless hechsher?



Answer



Yoni is correct, companies ask for kosher certifications for all sorts of reasons. (I know a rabbi who had his phone ringing off the hook from two American sugar companies begging for certification. Neither needed it from the laws of kosher per se, but both were hoping to sell to a confection company that had made a simple blanket rule, "all our suppliers must have kosher certification.") But there are actually other issues (at least in the USA) besides the milk per se. Vitamin D can be synthesized from mineral ingredients, or can be "all natural" from marine creatures. (After-the-fact it would be batel as it's not a flavor or enzyme.) The line could also produce chocolate milk or the like. Most of these problems would likely be batel after the fact, but many prefer to follow the Rashba's opinion that bitul is only relied upon in cases of mistakes.


Thursday, October 25, 2018

filters - Create a third octave spectrum from a time signal



I have to create a third-octave spectrum from a time signal on Octave GNU.
I found some code on the net to help me but I don't have all the parts of the algorithm.


I have a .csv file which contains a simple sinus temporal signal. The specifications are:



  • Duration: 0 to 180s

  • Frequency: 32768


I calculate the octave bands from 10Hz to 10kHz :


    fMin=10;
fMax=10000;

octs=log2(fMax/fMin);
bmax=ceil(octs/bw);

%Octave bands.
fc=fMin*2.^((0:bmax)*bw); %Center frequencies.
fl=fc*2^(-bw/2); %Lower frequencies.
fu=fc*2^(+bw/2); %Upper frequencies

After I can display all the third octave filters using Butterworth filters :


    bw = 1/3;

numBands = length(fc);

b = cell(numBands,1);
a = cell(numBands,1);

figure
for nn=1:length(fc)
[b{nn}, a{nn}] = butter(2,[fl(nn) fu(nn)]/(fs/2));
[h,f] = freqz(b{nn}, a{nn}, 1024, fs);


hold on;
plot(f, 20*log10(abs(h)));
end
set(gca, 'XScale', 'log')
ylim([-50 0])

Which gives to me :


enter image description here


The last filters are great but the first ones have missing points.
I don't know how to fix that and, mainly, how can I use this to make my third octave spectrum.

Does someone knows how to do this ?



Answer



Hate to answer this question, but it is a plotting issue, not the actual design problem. Basically, you don't have enough points at low frequencies cause they are spaced linearly and you are plotting on logarithmic scale. You could do:


[h,f] = freqz(b{nn}, a{nn}, logspace(log10(fMin), log10(fMax), 1000), fs);

Explicitly specifying the logarithmically spaced bins. Or you can use a very large N (something like $2^{16}$).


enter image description here


product recommendation - Good sources for Mishkan and Beis Hamikdash study


Anyone aware of any website, book, or video that you consider a really good resource for Mishkan and Beis Hamikdash study? It would optimally include diagrams, video animations, and other interactive stuff. And why do you recommend it?



Answer



I enjoy my copy of Carta’s Illustrated Encyclopedia of the Holy Temple in Jerusalem. It does a great job of helping the reader picture the architecture of the Mishkan and Beit Hamikdash and the service in them. I frequently refer to it for illustration when discussing these topics.


I also have enjoyed the novels I've read from the "Naftali in the Mikdash" series by Yaakov Meir Strauss. They try to give you a sense of what it was like to live in Israel when the Beit Hamikdash stood. Sometimes, the Halachic exposition is a bit forced, but if you don't mind the fact that you're learning the Halachot as you go a long, it's an enjoyable educational experience.


electrons - Hypervalency in elements in the second period


In my experience, most texts that address hypervalency say that it only occurs from elements in the 3rd period and onwards. This explains the occurrence of $\ce{Cl2O7}$ or chlorine heptoxide. However, some 2nd period nonmetals like $\ce{C}$ and $\ce{O}$ show hypervalency.


Examples:



  • $\ce{CH5}$ - This is unlikely to occur but it does sometimes happen that carbon bonds to 5 atoms instead of 4.

  • $\ce{H3O+}$ - Here oxygen is hypervalent.



How is it possible for carbon and oxygen to each have 9 electrons if each orbital only holds 2 electrons? Do they switch between electrons or something?



Answer



Normally when we talk about a single covalent bond, we are referring to a 2-centre 2-electron bond, which means that there are two electrons holding two atoms together.


Carbon never forms 5 bonds. The only exception that I know of is the $\ce{CH5+}$ methanium cation, the bonding in which can be explained by a 3-centre-2-electron bond. The same kind of bond appears in diborane ($\ce{B2H6}$). In both cases, the octet rule (or duplet rule in the case of the bridging hydrogens in diborane) is not violated. It is just that those 2 electrons are shared amongst 3 different atoms, so each "bond" is effectively half a bond (in MO theory parlance we say that the bond order is 0.5). You could think of it as three of the C-H bonds being normal 2-electron bonds, and two of the C-H bonds being half-bonds (having one electron each). The total number of electrons around carbon is therefore $3 \times 2 + 1 + 1 = 8$.


The neutral species $\ce{CH5}$ does not exist, because it has one more electron than the $\ce{CH5+}$ cation. That would mean that you either have to put 9 electrons around carbon, or put 3 electrons around hydrogen, both of which are of course not allowed.


The hydronium ion $\ce{H3O+}$ is not actually hypervalent. It is similar to the ammonium ion $\ce{NH4+}$ in that a dative bond is formed from the lone pair on O to a $\ce{H+}$ ion.


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{...