Thursday, 31 March 2016

number - Parshas Tzav - 96 Pesukim?


At the end of each Parsha many Chumashim have the number of Pesukim that are in that Parsha. By Parshas Tzav they all say 96 which is the Gematria of Tzav צו. However if counted there are 97 Pesukim. Was this done since there are really 96 Pesukim and 2 of the Pesukim are really one, or since it was only off by one it was a cute Siman? Some other reason?



Answer




This sefer suggests that according the author of the "Mesora", Vayikra 7:22 and 7:23 may be joined together, based on a Rambam (quoted by Shach YD 275:6) that differentiates the former Possuk from all other instances in the Torah. However he later notes (in his comments to the end of Sefer Vayikra) that if one adds up the totals written at the end each Parsha it falls one short from the total claimed for the entire book of Vayikra unless one counts Tzav as having 97 Pesukim.


Wikipedia claims that, "It is a widespread mistake that Parshas Tzav has 96 ("צו") Pesukim; an error that was even made its way into a number of Seforim. However in actuality there are 97 verses in the Parsha".


See also page 9 of this pdf.


matlab - Converting frequency from $textrm{Hz}$ to radians-per-sample


In MATLAB I have to pass cut-off frequency for designing a filter. But this Cut-off frequency is in radians-per-sample. How do I convert my analog Cut off frequency in $\textrm{Hz}$, into the required radians-per-sample for MATLAB?



Answer



Problems like these are best attacked using some dimensional analysis:


$$f_{[\rm rad/samples]} = f_{[\rm cycles/sec]}\cdot \frac{\text{sec}}{\text{samples}}\cdot \frac{\text{rad}}{\text{cycle}}$$



$$f_{[\rm rad/samples]} = f_{[\rm cycles/sec]}\cdot \frac{2\pi}{f_s}$$


where $f_s$ is the sample rate in $\textrm{Hz}$.


solutions - What if solute and solvent exist in equal quantities?


A solution is made of solute and solvent, like salt in water, however, what if the solute and solvent exist in equal quantities? Which one is the solute and which is the solvent? If one of them is water I think it will definitely be the solvent, but what if neither of the two parts are water?




Wednesday, 30 March 2016

image processing - Understanding the Bilateral Filter - Neighbors and Sigma


I have been reading about the Bilateral Filter in - Fast Bilateral Filtering for the Display of High Dynamic- Range Images and have felt crippled and confused while understanding its working and the parameters.


In the equation for Bilateral Filter given as


enter image description here



  • How to determine the number of neighboring pixels?

  • Are all adjacent pixels the neighboring pixels? (top, right, bottom, left, diagonal)

  • What does it really mean when people say the following (underlined):



enter image description here


Please help me understand this. I feel lost as I try to understand and gain an intuition of the Bilateral Filter.


I plotted a graph of the Gaussian function (y-axis represents the value of Gaussian function;) with three-sigma values 0.2, 0.5 and 0.9 to help me understand but got nothing.


enter image description here


(blue = 0.2, green = 0.9)




parshanut torah comment - Why did Achashveirosh take Esther if she was already married?


According to the opinion that Queen Esther was married to Mordechai.





Achashveirosh was looking for unmarried girls (Esther 2:2–4). Why did he take a married woman? Especially considering that Queen Esther was not looking to get married, why didn't she just make her marital state public?



Answer



It is possible that, though the idea as originally outlined for the king by his advisers did in fact include the criterion of 'besulot', when the king issued the edict that criterion was omitted. Hence we do not find it listed in 2:8 and on, where it lists נְעָרוֹת alone:



וַיְהִי, בְּהִשָּׁמַע דְּבַר-הַמֶּלֶךְ וְדָתוֹ, וּבְהִקָּבֵץ נְעָרוֹת רַבּוֹת אֶל-שׁוּשַׁן הַבִּירָה, אֶל-יַד הֵגָי



translation - What does exactly does さま mean in dictionary definitions?


I've been using Japanese-Japanese dictionaries for a while now and this keeps popping up. It seems to me like a kind of usage that is found for the most part only in dictionaries. Can anyone help explain what exactly さま means in the dictionary definition below? (It's from 大辞泉.) It seems to be just a generic object that they modify with the term's definition, i.e. XYZ is a blah blah blah さま (thing).



ささ‐やか【細やか】


[形動][文][ナリ]1 形や規模があまり大げさでなく、控えめなさま。「―な商売をはじめる」「―に暮らす」



Any clarification would be really appreciated.




hashkafah philosophy - How do we understand Talmudic predictions of Moshiach?


There are some predictions in the Talmud for when Moshiach/Messiah will come.



Avoda Zara 9b brings a Beraisa and Rabbi Chanina that say when Moshiach will come (the opinions are a few years apart), and it uses language that seems to say that there is no chance that he won't come by then. I can speculate that maybe they just use the wording as a demonstration of them being eager for Moshiach, but if I knew I wouldn't be asking the question. Also it's not clear if they're saying "Don't buy land on a contract that will transfer ownership to you after 4231" or "For those who will live in the future, don't bother buying land because Moshiach will come any minute and it's a sign you don't have faith in that." Here it is:



(R. Chanina): Do not waste money buying land 400 years after the Churban, even for a pittance, for surely Mashi'ach will come then (and land will revert to its rightful heirs based on the division in the days of Yehoshua bin Nun).


(Beraisa): Do not waste money buying land in the year 4231, even for a pittance, for surely Mashi'ach will come then.



Sanhedrin 97b brings in Eliyahu who seems to say that Moshiach will come by the end of 85 Yovel cycles (and at 50 years each, that is 4250 years total), and Eliyahu seems to be saying that he is not sure if Moshiach will come before the end of this last cycle (but I could be misreading):



Eliyahu: The world will be at least 85 Yovel cycles. Mashi'ach will come in the last one.


Rav Yehudah brother of Rav Sala: Will he come at the beginning or at the end?


Eliyahu: I do not know. (Ramah's text - he will come at the end.)



Rav Yehudah: Will Yovel finish before he comes? (Maharsha - will he surely come then, or may he be delayed further?)


Version #1 - Eliyahu: I do not know.


Version #2 (Rav Ashi): Eliyahu told him, do not wait for him until this time. Afterwards, wait for him.



How was it understood by the rabbis quoted who lived a few hundred years before the time mentioned, by the rabbis who compiled the Gemara shortly before or around the year mentioned, and by Rashi and other later commentators long after the time has passed? What do we make of this so many centuries after this predicted date has passed?



Answer



The same daf in Sanhedrin 97b a few lines down basically answer the question.


see what R' Shmuel Bar Nachamani says about those who calculate the arrival of mashiach ,he uses the loshon of tifach and writes people lose emunah because of it.He seems to disagree with the Rabbanim who made calculations.


A few more lines down Rav says all the keitzeim (calculations are over) only Teshuvah and mitzvos will bring Mashiach. It seems that there were ways to calculate but once that time passed this is how it should be done(Shmuel learns differently). See the whole daf for further explanation.


organic chemistry - What is the hybridization of the carbonyl oxygen in a carboxylic acid?


My professor sent out a review guide. One of the questions on this guide is



The carboxylic acid carbonyl oxygen is:

1. $\ce{sp^2}$
2. $\ce{sp^3}$
3. $\ce{H}$-bond donor
4. rapidly equilibrating between $\ce{sp^3}$ and $\ce{sp^2}$
5. 1 and 3
6. 1 and 4



I chose (4) because of the resonance that can be drawn with a negative oxygen and positive carbon. However apparently the answer is (6). I don't understand how something can be equilibrating between two states and still be one of those states.


Could anyone explain?




grammar - VかV-negか vs. V | V-neg vs. Vかどうか


Is there any difference in meaning between these three structures? I think they all roughly mean "whether or not" but are they interchangable? Examples below:



両親は賛成するかしないかにかかわらず、僕は君と結婚します。



vs




明日来る来ないにかかわらず、必ずわたしに電話してください。



vs



明日は仕事を守れるかどうかが不安だった。




Answer



All of the forms that you have listed have the same effective meaning and are interchangeable, so long as they follow the proper context. Cross-searching these examples on Weblio, they are pretty much all listed as synonyms, with some seemingly trivial usage differences that I do not think will actually dissuade most speakers from using them interchangeably.




するかしないか standard colloquial


するしない casual colloquial




するかどうか standard (spoken or written)


するか否{いな}か formal (usually written); somewhat pedantic



To use as an example some advice once given by Master Yoda:



「やる」か、「やらない」かだけだ → OK


「やる」、「やらない」だけだ → OK



「やる」かどうかだけだ → a little strange (not quite casual enough)


「やる」か否かだけだ → strange (mixing formal with casual)



Finally, 「するのかしないのか、」or 「するのしないの、」 could be used to carry a separate nuance; one of impatience and frustration; e.g. ‘So, are you going to do it or not!?’.


If someone has another take I will be happy to consider editing.


blessing - If someone asks you to pray for them, is that shitoof?



If you have a friend who wants to succeed at a task, or needs healing, and he asks you to pray for him even though he can pray himself, is he using you as an intermediary, like shitoof? Am I confused on the definition of praying for someone and shitoof?




purim torah in jest - What did "נ ג ה פ" stand for before the miracle?



As is well known, the reason we play dreidel on Hanukkah is this: Before the miracle of Hanukkah, when the gentiles who controlled the land severely restricted Torah study, Jewish children would gather to study Torah in secret, and brought dreidels with them so that, should they be discovered by the authorities, they could appear to be playing rather than studying.


Nowadays, the letters "נ ג ה פ" on a dreidel stand for "נס גדול היה פה", "a great miracle happened here", viz the miracle of Hanukkah. But these children were playing dreidel before the miracle of Hanukkah! So what did "נ ג ה פ" stand for at that time?







Answer



When the end of prophecy occurred at the destruction of the first temple, it was given to the children. Obviously then, the children knew by prophecy what was supposed to be on the dreidel.


Tuesday, 29 March 2016

pronunciation - How to say 24 divided by 8 equals 3


Pretty sure you have to use 割 but I don't know which pronunciation to use and how to say "equals" in this context.



Answer



It's read as 「24割る8は4」「にじゅうよんわるはちはよん」[nijuu yon waru hachi wa yon]. (I think we often say「24割る8イコール4」「にじゅうよんわるはちイコールよん」[nijuu yon waru hachi ikooru yon] after junior high school...) Wait, 24÷8=...4? Isn't it 3?


word usage - What is the reasoning behind picking お or ご as an honorific prefix?


We've learnt that お is used for 訓読み and ご is used for 音読み. I want to know why we use お上手 and お電話. Why can't we use ごじょうず and ごでんわ?




culture - How do Japanese speakers transition from polite to plain form amongst friends?


When you first meet somebody, polite language is, on the whole, the most commonly used form of Japanese. Children may differ, and I understand that not everyone will use plain form, but regardless a majority of people do.


At some point in a friendship, inevitably friends will switch to plain form. Again, different people are comfortable to do this at different times, but how do people make the transition from polite to plain language? Do they just start using it, and the other person just plays along? Is it a gradual thing, where you switch in and out of plain form and then just stick to it after a while after using it more and more?



Personal experiences and examples are welcomed




words - What is the meaning of יוֹם (yowm) in Bereshit?


I've heard conflicting reports of how the creation days , יוֹם (yowm), in Bereshit are interpreted in the Jewish community. How do actual Hebrew scholars define day in Bereshit? six 24 hour periods or six long periods of time? Is one view favored over another(By hebrew scholars), does each viewpoint have about equal support, or is there no argument?




halacha - Meat Flavor during the nine days


I cook hard boiled eggs with shells in meat cholent and was wondering if I could eat them during the nine days. If cooked before Rosh Chodesh Av or after - would that make a difference?




halacha - When did kosher bakeries, restaurants, etc. start requiring supervision?


If my neighbor Shmerel keeps kosher and otherwise appears to be observant to the best of my knowledge, then I'd be allowed to eat in his house (assuming I'm invited), eid echad ne'eman b'issurin, his "testimony" is sufficient.


Now what happens if it's not his house, but his foodservice business?


My impression (correct me otherwise?) is that when there were bakers and innkeepers (my impression is that people didn't eat out in restaurants, but would stop at inns when travelling) in the Talmud, their kashrut was self-certified.


Today, it's strongly normative for a bakery, ice cream shop, or the like to have external certification, even if owned and run by a kosher-observant Jew.


How long has that been the practice? Do we know anything else about its history?


I'm specifically not asking about matza factories or kosher slaughter, which have a long tradition of being under the town rabbi's supervision. For instance, Shulchan Aruch (Safed and Cracow, c. 1550) opens the laws of kosher slaughter with "who can perform shechitah"; by the time we reach Chochmat Adam (Vilna, c. 1800), his Chapter One begins: "the knives of a town's kosher slaughterers are the property of the town rabbi and under his control."




Monday, 28 March 2016

history - Where are the lost tribes?


Are they spread all round the nations? If so, how will they still be Jewish, surely they will have assimilated so many generations later? Or are they spread within the Jewish nation?


I learnt in the Talmud in Bava Basra 115b which states that Abaye says "we have a tradition saying no Shevet will ever get extinct". If so, where are these tribes? It's always disturbed me.




purim torah in jest - How did my rabbi kasher his iPhone?



My local Orthodox rabbi regularly sends me emails about upcoming events, minyanim, etc. I notice that at the bottom of each message it says "Sent from my kosher iPhone".



How did he kasher his phone? Did he toivel it in a mikvah, pour boiling water over it, heat it up to the temperature it was fabricated at? Should I do this to my phone too?







Sunday, 27 March 2016

halacha - How much can you wipe your muddy shoes on a doormat on Shabbos?


I intend to ask this question in light of all Shabbos prohibitions, including carrying (insofar as deliberately removing something may bear, retroactively I guess, on its חשיבות), as well as dosh, tochen, losh, melaben, tzoveia, memachek, makeh b'patish and anything else that could come in. And of all types of mud: dry mud, wet mud, deeply embedded mud, crumbly mud, caked mud, and so on. (And of all types of doormats: wet; dry; is one with bristles a problem?)


What, in practice, should one do? Taking one's shoes off at the door is not a great option for Jewish life unless one has other shoes inside. Simply tracking the mud inside is not either.




thermodynamics - How is Standard Gibbs free energy measured?



I have seen hole theory of thermodynamics but almost nothing about the experiments that measure $\Delta G^\circ$. I know how to measure it by electrodes, when the reaction is a redox one. But what with other reactions?


What are the experimental ways to determine $\Delta G^\circ$? Some examples would be helpful



Answer



Generally you measure the equilibrium constant $K$ and then convert it to $\Delta G^\circ$ (note that is change in standard free energy)


$ \Delta G^\circ = -RT \ln K $


In the case of redox reactions, this can be done with electrodes as you mention. For other reactions you usually use some spectroscopic technique (NMR, IRC, UV, etc) that can distinguish reactants from products, but calorimetry can also be used in certain cases.


Here is a video describing one example using UV.


organic chemistry - Why do other sugars melt whereas sucrose decomposes?



Sucrose decomposes at 186 °C. It doesn’t melt but when it reaches decomposition temperature, sucrose decomposes into fructose and glucose.


After cooling and hardening it is no longer sucrose. Am I right?




power spectral density - What does PSD represent in the spatial domain?


People use FFT methods to analyze topographic features in the spatial domain, such that the signal varies over (x) rather than (t). If a PSD curve characterizes amplitude versus frequency of an electrical signal, the dominant peaks of the PSD point to which frequencies contain the most power - if I understand correctly.


That being the case, what exactly does the y-axis in a PSD for a physical surface represent? Power has a very specific definition in physics. Is the geometric term Area more appropriate than Power when interpreting a spatial domain PSD curve? I'm having difficulty conceptualizing and translating the terminology and units from the temporal to the spatial domain.




DISCLAIMER: I have many questions to ask about FFT, but am new to the community and am trying to respectfully constrain the scope of my questions, so I plan to ask them separately (which I believe is the preferred format). That said, here is some background.



This is 1m-resolution multibeam sonar data, gridded to 5m, with near 100% coverage. The surface in question is coral reef seafloor, which under certain conditions forms linear features (seen below). The dimensions of these features vary with both depth and coastal aspect. My interest here is to use FFT to quantify the changes in both frequency and amplitude, so that I can assess their correlation with various environmental variables. My understanding is that if I can use FFT correctly, I can extract the dominant signal frequency/frequencies; if so, I hope to document how these dominant frequencies change from one area to the next.


Moving-window analysis neighborhood; extracted portion of topographic features. The image above gives a good sense of my workflow. I start with a grid of points, which serve as neighborhood centroids for my moving-window analysis. Selecting one point (in green), I define my analysis window, calculate the average direction of features, and draw a line perpendicular to them. What you don't see is the elevation profile that's extracted, but below is the resulting PSD. In this question I'm seeking to understand the output of FFT.


Output PSD


I hope to execute this analysis for each grid point, and write results to file. In later questions I'll ask what metrics I can pull from FFT analysis; how exactly to tune the input data for FFT (windowing/ zero-padding/ base-2 # of samples); and whether there are best practices for determining how many spectral peaks to record.



Answer



Please see this response. Radiant Flux should take care of the physical units.


The PSD in the spatial domain would represent a "dominant" blob, whose shape is determined by the spectral content of the PSD, underlying the image. (Please note that the PSD is defined over the Fourier Transform of the autocorrelation of a signal).


EDIT:


So, your pixel size is 5mx5m and the actual length of your red line is (let's say) about 500 meters across and contains 164 samples. Let's assume a square pixel size and call it $P_s$, call the length of the line $L$ and the number of samples across the line $L_s$.


You perform an FFT on the profile line ($x_n$) and calculate the amplitude spectrum as the absolute value of the complex spectrum of $x$ (i.e numpy.abs(numpy.fft.fft(myData))). This gives you $|X_k|$.



From that, you can see one sinusoid clearly sticking out of the rest at a frequency bin of 12. What does this mean for the ridge?


The formula that links the bin to the actual spatial frequency is $f = \frac{k}{L_s} \times \frac{1}{P_s}$ where $k$ is the frequency bin.


But, what is $\frac{1}{P_s}$?


The FFT decomposes a waveform into a sum of sinusoids at different frequencies. It will take the waveform from the spatial domain (height of ridge ($x_n$) at well defined points in space ($n$)) to the frequency domain (amplitude of sinusoids $|X_k|$ that make up the waveform over the same well defined points in space). The variable $k$ ranges from 0 (also known as DC) to $L_s$, corresponding to actual physical frequencies $f$ between DC and $F_s$.


By the way, you only show the real part of the FFT, which means that your $k \in [0 \ldots \frac{L_s}{2}]$ and your $f \in [0 \ldots \frac{F_s}{2}]$.


$F_s$ stands for Sampling Frequency and is usually expressed in Hertz (Hz). 1 Hz means 1 cycle per second. PAUSE.


Imagine a signal in the time domain, it looks like $x(t)$. For every time instance $t$ we collect a sample $x(t)$. If we sample it regularly at some sampling frequency $F_s$ then the distance (the sampling period $T_s$) between successive time instances $t,t+T_s$ is $T_s = \frac{1}{F_s}$. PLAY.


So, you know that you have sampled space once every 5m. That is, $T_s= 5m$. Then, what is $Fs$ when I know $T_s$? ... That's what $\frac{1}{P_s}$ is.


And as you can see from the above simple formulae, the longer the line, the more samples you obtain from the bottom, the more clearly you can tell spatial frequencies apart.


OK, now we know how to translate between what the FFT tells us and actual spatial frequency. For this example $f=\frac{12}{164} \times \frac{1}{5} \approx 0.014Hz$. OK...ok...What does this mean? It means that your ridge, as idealised by a single sinusoid has a period of $T = \frac{1}{0.014} \approx 71.428$ meters. That is, one period of sand raising and then dipping is about 71 meters across.



But, what about height? I read an amplitude of 42 on my single powerful harmonic, does this mean 42 meters?!?


No. Different scientific packages might "implement" slightly different formulas for the FFT. If you are within the Python ecosystem, you are likely to be using numpy. So, for this purpose, take a look at this link. You see how the forward transform is just a sum but the inverse transform has a $\frac{1}{n}$ in front of it? That's because of the way the "averaging" works. So, when you read 42, in reality it is an amplitude of $\frac{42}{L_s} \approx 0.25$ meters or about 25cm. Of course, I am assuming that your height is measured in meters here.


These are the "basics", if you like. There are a few more things that, I suppose, are going to come into play later on.


For example, is a single sinusoid good enough to represent the cross section of a ridge pattern? Personaly, I have no idea, but I am sure that there are ways for you to find out. In general though, you can order the amplitudes of the harmonics of the FFT in decreasing order and keep adding them until you have reached something like 90% of the total amplitude. This might not extend to more than 4-5 coefficients in places where the ridge is very clear. Another way to select coefficients is, of course, by estimating the goodness of fit of a set of $n$ sinusoids to explaining the total variation of the amplitude in the obtained sample, there are many different ways to carry out this step. The more coefficients you include of course, the better your representation but the more difficult the interpretation. However, you can collect these coefficients and correlate them later on with other features from your reef and see if there is something that could explain the ridge pattern better. Maybe stiff corals create strong objects which result in turbulent flow but soft seaweed or flexible flora bends and follows the current and slows it down and contributes to a more laminar flow (?).


Another thing is, how do you judge that what you "see" in front of you is good enough to be characterised as a ridge pattern. The algorithm is unsupervised so it might well go over a patch where the flow is so turbulent that it doesn't leave a well defined pattern. The mathematical pipeline will still do its work and come back with numbers but it is likely that these won't mean anything. You can easily see for example that if we were looking naively for a single powerful sinusoid from [4,4,4,4,5,4,4,4,4,4,4,], we would say 5...But that's not correct. For this reason, I would suggest that as a criterion to whether or not you go ahead with harmonic analysis of a path you first apply a Spectral Flatness metric which will tell you very quickly if the spectrum is "spikey" or close to flat. So, now, you can put a threshold on flatness and say something like "If the spectrum is too flat then don't even bother with FFT and the rest, just characterise this patch of sand as "unsuitable""...or something like that.


Hope this helps.


EDIT:


To clarify points in the ensuing discussion, I am adding here the following code with detailed comments.


import numpy
from matplotlib import pyplot as plt


#Some simple setup
signalDuration = 4; #Seconds (METERS in your case)
samplingFrequency = 100; #Samples Per Second (NUMBER OF SAMPLES ALONG YOUR SONAR PROFILE)
timeVector = numpy.linspace(0,signalDuration,samplingFrequency * signalDuration) #Discrete time (DISCRETE SPACE IN YOUR CASE)
phaseVector = 2.0 * numpy.pi * timeVector #Discrete phase. I am doing this to get rid of mul by 2*pi all the time, don't worry too much.

#Some Signal (the actual shape of it doesn't matter too much here)
Q = 7.0
A = 1.0

B = 1.0
C = 4.0

#With S here, we simulate your readings. The actual signal doesn't matter
S = Q + (A * numpy.sin(8.7*phaseVector) + B * numpy.sin(8*phaseVector)) + C * numpy.sin(2 * phaseVector)

#Let's look at our signal
plt.plot(S);plt.grid(True);plt.title("S in the time domain")

#Fourier Transform (this is the original spectrum)

FS = numpy.fft.fft(S)

#AMPLITUDE SPECTRUM. NOTICE THE SCALING FACTOR!
FS_AMP = 1/float(len(S)) * numpy.abs(FS)

#In a semilogy axis so that we can see all harmonics
plt.figure()
plt.semilogy(FS_AMP);plt.grid(True);plt.title("S in the frequency domain (AMPLITUDE SPECTRUM)")

#In a linear axis so that we can look at the amplitudes of each individual harmonic

plt.figure()
plt.plot(FS_AMP);plt.grid(True);plt.title("S in the frequency domain")

plt.show()

#The first spectral line is your C (because it is at the lowest frequency).
#The second spectral line is your B
#The third spectral line is your A
#
#Look at the spectral line that corresponds to C. We specified 4.0. Fourier Transform tells us 2.0.

#WE SPECIFIED 4.0 AND WE DO GET ABSOLUTE AMP OF 4.0 (remember the symmetry of FFT), similarly for the rest.
#Now, if you ignore Q (which is just a constant that I used to offset the measurements on purpose)
#Harmonic C is approximately 66% of the total amplitude.

Hope this helps.


bandwidth - Bounds of the derivative of a bounded band-limited function


Let $f(t)$ be a function with properties:


$$\begin{array}{ll} t\in\mathbf{R}&t\text{ is in reals}\\ f(t)\in\mathbf{R}\text{ for all } t&f(t)\text{ is in reals}\\ |f(t)|

Given $A$ and $B,$ what is the tight upper bound for $|f'(t)|,$ the absolute value of the derivative of the function?


Nothing else shall be assumed about $f(t)$ than what has been stated above. The bound should accommodate for this uncertainty.



For a sinusoid of amplitude $A$ and frequency $B,$ the maximum absolute value of the derivative is $AB.$ I wonder if this is an upper bound, and in that case also the tight upper bound. Or maybe a non-sinusoidal function has a steeper slope.



Answer



You'll be interested in Bernstein's inequality, which I first learned about in Lapidoth, A Foundation in Digital Communication (page 92).


With a well-behaved signal $f(t)$ as you defined it above (in particular, $f(t)$ is integrable and bandlimited to $B\,\text{Hz}$, and $\text{sup}\,|f(t)| = A$), then $$\left|\frac{\text{d}f(t)}{\text{d}t}\right| \leq 2AB\pi. $$


Note that the original result by Bernstein established a bound of $4AB\pi$; later, that bound was tightened to $2AB\pi$.




I have spent some time reading Zygmund's "Trigonometric Series"; all I'll say is that it is the perfect remedy for those under the impression that they know trigonometry. A full understanding of the proof is beyond my mathematical skill, but I think I can highlight the main points.


First, what Zygmund calls Bernstein's inequality is a more limited result. Given the trigonometric polynomial $$T(x) = \sum_{-\infty}^\infty c_k e^{jkx}$$ (with real $x$), then $$\max_x |T'(x)| \leq n \max_x |T(x)|$$ with strict inequality unless $T$ is a monomial $A \cos(nx+\alpha)$.


To generalize this we need a preliminay result. Consider a function $F$ that is in $\text{E}^\pi$ and in $\text{L}^2$. ($\text{E}^\sigma$ is the class of integral functions of type at most $\sigma$ -- this is one of the places where my math starts to fray at the edges. My understanding is that this is a mathematically rigorous way of stating that $f=\text{IFT}\lbrace F \rbrace$ has bandwidth $\sigma$.)


For any such $F$ we have the interpolation formula $$F(z) = \frac{\sin(\pi z)}{\pi}F_1(z),$$ where $z$ is complex and $$F_1(z) = F'(0) + \frac{F(0)}{\pi} + \sum_{n=-\infty}^\infty {^\prime} (-1)^nF(n) \left( \frac{1}{z-n}+\frac{1}{n} \right).$$ (This is theorem 7.19.)



Now we can state the main theorem. If:



  • $F$ is in $\text{E}^\sigma$ with $\sigma>0$

  • $F$ is bounded on the real axis

  • $M=\sup |F(x)|$ for real $x$


then $$|F'(x)| \leq \sigma M$$ with equality possible iff $F(z) = a e^{j\sigma z} + b e{-j\sigma x}$ for arbitrary $a,b$. We suppose that $\sigma=\pi$ (otherwise we take $F(z\pi/\sigma)$ instead of $F(z)$.)


To prove this, we write the derivative of $F$ using the interpolation formula above: $$F'(x) = F_1(x)\cos(\pi x)+\frac{\sin(\pi x)}{\pi} \sum_{n=-\infty}^\infty \frac{(-1)^nF(n)}{(x-n)^2}.$$ Setting $x=1/2$ we get $$F'(1/2) = \frac{4}{\pi} \sum_{n=-\infty}^\infty \frac{(-1)^nF(n)}{(2n-1)^2}$$ which implies $$|F'(1/2)| \leq \frac{4}{\pi} \sum_{n=-\infty}^\infty \frac{1}{(2n-1)^2} = \frac{4M\pi^2}{4\pi} = M\pi.$$


Now we need a nice little trick: Take an arbitrary $x_0$ and define $G(z) = F(x_0+z-1/2)$. Then, $$|F'(x_0)| = |G'(1/2)| \leq M\pi.$$


(TODO: Show the proof for the case of equality. Define $\sum \prime$.)



halacha - Al Netilas Yadayim in morning and after bathroom


Are you supposed to say the bracha al netilas yadayim after doing negel vasser after waking up or going to the bathroom?




filters - What is the true meaning of a minimum phase system?


What is the true meaning of a minimum phase system? Reading the Wikipedia article and Oppenheim is some help, in that, we understand that for an LTI system, minimum phase means the inverse is causal and stable. (So that means zeros and poles are inside the unit circle), but what does "phase" and "minimum" have to do with it? Can we tell a system is minimum phase by looking at the phase response of the DFT somehow?



Answer



The relation of "minimum" to "phase" in a minimum phase system or filter can be seen if you plot the unwrapped phase against frequency. You can use a pole zero diagram of the system response to help do a incremental graphical plot of the frequency response and phase angle. This method helps in doing a phase plot without phase wrapping discontinuities.


Put all the zeros inside the unit circle (or in left half plane in the continuous-time case), where all the poles have to be as well for system stability. Add up the angles from all the poles, and the negative of the angles from all the zeros, to calculate total phase to a point on the unit circle, as that frequency response reference point moves around the unit circle. Plot phase vs. frequency. Now compare this plot with a similar plot for a pole-zero diagram with any of the zeros swapped outside the unit circle (non-minimum phase). The overall average slope of the line with all the zeros inside will be lower than the average slope of any other line representing the same LTI system response (e.g. with a zero reflected outside the unit circle). This is because the "wind ups" in phase angle are all mostly cancelled by the "wind downs" in phase angle only when both the poles and zeros are on the same side of the unit circle line. Otherwise, for each zero outside, there will be an extra "wind up" of increasing phase angle that will remain mostly uncancelled as the plot reference point "winds" around the unit circle from 0 to PI. (...or up the vertical axis in the continuous-time case.)


This arrangement, all the zeros inside the unit circle, thus corresponds to the minimum total increase in phase, which corresponds to minimum average total phase delay, which corresponds to maximum compactness in time, for any given (stable) set of poles and zeros with the exact same frequency magnitude response. Thus the relationship between "minimum" and "phase" for this particular arrangement of poles and zeros.


Also see my old word picture with strange crank handles in the ancient usenet comp.dsp archives: https://groups.google.com/d/msg/comp.dsp/ulAX0_Tn65c/Fgqph7gqd3kJ


cross correlation - Measuring time delay of audio signals


Before anyone yells at me I fully realize that this question has been asked numerous times. I assure you that I've read through the existing questions and answers but I am still confused about part of the problem.



I have a sound source that plays music (A) in a closed environment. I have a mic that I'm using to record A. I am left with two wav files which share the same characteristics and length (number of samples).


My goal is calculate the time it took for A to reach the mic.


I am trying to perform the calculation using cross-correlation (numpy):


# Delay estimation
corr = numpy.convolve(original_audio, recorded_audio, 'full')
delay = int(len(corr)/2) - numpy.argmax(corr)
distance = delay / sample_rate * 343 # sample_rate == 22050, m/s = speed of sound
print("Distance full: %.2f cm" % (distance * 100))

I consistently obtain values in the 300,000 cm range. The distance between the speaker and mic is approximately 2 feet.



This is all pretty new to me so I'm sure I'm missing something obvious.


Thanks in advance.



Answer



Are you sure you shouldn't be using numpy.correlate instead of numpy.convolve? To estimate delay, you want to cross-correlate your signals, not convolve them. You'll possibly end up with a much larger delay by convolving.


Trying something simple:


x = [1, 0, 0, 0, 0 ];
y = [0, 0, 0, 0, 1 ];
conv = numpy.convolve(x,y);
conv
array([0, 0, 0, 0, 1, 0, 0, 0, 0])

corr = numpy.correlate(x,y,"full");
corr
array([1, 0, 0, 0, 0, 0, 0, 0, 0])

organic chemistry - What is the rationale of the IUPAC name for DDT?


The structure of DDT is


enter image description here


One of the benzene molecules should be the parent chain as it has a greater number of carbon atoms than the straight chain (which has just two carbon atoms). Taking benzene as the parent chain, I think that the name of the compound should be 1-Chloro-4-((1'-(4"-chlorophenyl))-2',2',2'-tricholoroethyl) benzene.



But the Wikipedia article states that the IUPAC name of the compound is 1,1,1-Trichloro-2,2-bis(4-chlorophenyl)ethane.


Why is the ethyl chain taken as the parent chain when it has lesser number of carbon atoms than the benzene ring?




jewish books - Where can I find indexes to the classic Torah works?


I want indexes (indices) to the classic Torah works, so that I can quickly find the pages that hold the information I need. Where can I find such indexes?



Answer





  • Chumash:




    • The Stone Chumash, the Soncino chumash, and R' Aryeh Kaplan's chumash each include an index.




  • Tanach:



    • The Stone Tanach includes an index.





  • Talmud Bavli:





  • Shulchan Aruch:



    • Karo, J. E., Isserles, M. I., Preisler, Z., Havlin, S. (1993) (in Hebrew).
      שלחן ערוך / לרבינו יוסף קארו ; עם המפה (הגהות הרמ״א) לרבינו משה איסרליס ; נערך, סודר והודפס מחדש בכרך אחד עם פיסוק ועם האיזכורים מהמקרא, מלווה בששה מפתחות ; בעריכת צבי ה. פרייזלר, שמואל הבלין.‏
      One-volume edition, fully vowelized, with indexes. No commentaries. WorldCat. Important: In WorldCat, use "Show libraries holding just this edition" to get a list of only the libraries that hold the 1993 Ketuvim edition and to get a list of only the libraries that hold the 1995 Ketuvim edition.





  • Mishna Berurah:



    • Yad Yisrael by Daniel Eidensohn. English-language and Hebrew-language editions available.




  • Igros Moshe:






  • You can find indexes to other works too. For example, see <http://books.google.com/books?id=347YayHXEEcC&pg=PA115> and the succeeding pages.




halacha - Saying Kaddish Yatom with Permission from Living Parents



If both of my parents are living and they give me a reshut to say kaddish yatom if there is no avel, however the rav wishes that I not say it due to possible issues of marit ayin, who do I follow?


Of course, CYLOR (however I'd like sources when I discuss this with them).




fft - Removing noise from audio using Fourier transform in Matlab


I'm trying to remove noise from an audio file. This audio file contains speech as well as constant pink noise. I know that I have to use the Fourier transform to convert to the frequency domain then use a filter to filter out the frequencies of the pink noise, but I really don't know where to start with that. It also seems that the noise covers many more frequencies than the speech file (I have the speech and noise files separately) by looking at the plots in the frequency domain.



Doesn't that mean that if I filter out the frequencies of the noise it'll remove all the speech as well?


The plot of the speech audio in the frequency domain displays that the frequencies are mostly between -450 and 450.


The plot of the noise alone in the frequency domain displays that the frequencies are between -2000 and 2000. This clearly covers a much wider range of frequencies than the speech audio.


Does this mean I can't remove it from the noisy speech audio without removing the speech too? Or can I remove the frequencies outside of -450 and 450 and that would remove much of the noise? If so, how do I compute the range of frequencies instead of looking at plots myself to see the range?




Saturday, 26 March 2016

audio - How to mix 8bit/8kHz unsigned linear PCM data in AppsScript?


I am having the most difficult time mixing simple unsigned 8-bit/8kHz linear PCM audio samples in JavaScript (AppsScript). I've tried all the basic maths listed here, employing basic number arrays.



  1. Sign, add, clip, unsign. Subtract 128 from each byte, add them, clip, then add 128.

  2. Produce the Average, each sample just a[x]+b[x]/2


  3. Viktor T. Toth's, maths linked.


Full example is below. This will ask you to authorize Google Drive to access the audio samples (no it does NOT touch anything of yours): https://script.google.com/macros/s/AKfycbzMOWV5Z5soG3uinrFc0WcscNXxsDq9elE9rzG0t703vsvDJZMS/exec


As you can see the 3 mixed results are downright horrible. I've always assumed the unsigned bytes were just offset by 128. Not the case? Do I need to fold half the byte to get a true linear representation? Does a basic number in JavaScript not translate appropriately into signed/unsigned representation? If that's the case the Java/AppsScript is somehow properly doing it with the two real samples.




Update Here is some specific code below, and the output of this is in the link above. Alas, it simply doesn't quite work (byte folding in JavaScript)?
   var vegaArray = DriveApp.getFileById('0B-e9EqGm0pWPQ3RUTXFyUERDVTA').getBlob().getBytes();
var fdraArray = DriveApp.getFileById('0B-e9EqGm0pWPaUJQUmFRQWctNG8').getBlob().getBytes();

for(var i=44;i
vegaArray[i] = Math.round( ( 2 * (vegaArray[i] + fdraArray[i]) )
- ( vegaArray[i] * fdraArray[i] / 128 )
- 256
); // for
// vegaArray[] is the mixed output


halacha - Can we violate Shabbos to inject a vaccine?



Vaccines save lives. I'm not here to argue about that, take it somewhere else. If you don't agree, for the purposes of this question just imagine I'm talking about some medicine that accomplishes vaccination, but is magically safe from whatever invented danger that bothers you about it.


Vaccines save lives. However, they are not administered to treat a current illness -- they are given to prevent dangerous illnesses from coming.


Since we know that one may only violate Shabbos for a חולה שיש בו סכנה (patient who is in danger for his life) for things that have to do with saving that patient's life (see Rambam, Hilchot Shabbos 2 (English), Shulchan Aruch, Orach Chaim 328), if we would have to be מחלל שבת in order to administer vaccines1, would we be allowed to violate Shabbos to administer vaccines?




1 It's debatable whether any injections are Biblical Shabbos transgressions, see שמירת שבת כהלכתה ch 32:58, and footnote 151 there; it appears that all agree that subcutaneous and intramuscular injections are not biblically prohibited. For the purposes of this discussion, let's assume that there is some universally agreed-upon Biblical transgression involved, such as driving a car in order to get it, or writing a prescription for it.



Answer



Shemiras Shabbas K'hilchasa 32:62 -- one is allowed to inject vaccines where there is a concern that the patient will become dangerously sick.


If a doctor feels that this is urgent, then even biblical transgressions such as driving a car or writing a script are allowed, where necessary.


In footnote 160, there, Rav Neuwirth cites what he wrote earlier, in footnote 60. There, he retells the story about Rabbi Yisrael Salant, who decided that one year (according to Wikipedia, 1848), nobody should fast on Yom Kippur, due to a concern for a cholera epidemic. However, Rav Neuwirth notes there (60) that one should try to do what needs to be done in a different way than usual (שינוי), where possible.


halacha - Greeting someone before the morning prayers


What exactly is the halacha regarding greeting someone before praying shacharit?



Are you allowed to say "good morning" as you pass someone before you pray shacharit? What about saying shallom aleychem to a person you haven't seen for a while?


Is the case different for when you encounter your rabbi?



Answer



From Halachpedia:



If one met one’s friend in the market (in a happenstance way) one may greet him with good morning and not Shalom. If this is a powerful person, and one meets him on the way, one can tell him "Shalom" .


This prohibition only applies to greeting someone, but it’s permissible to respond to someone who greeted you.


One may not go to someone’s house to greet them with “Shalom” once the time for Shacharit began. If one met the person on the way, it is preferable not to greet with “Shalom”.


Once the time for Shacharit comes until one said Brachot HaShachar one may [not] greet one’s friend with the word Shalom but rather with good morning.


If one went out of one’s way to greet one’s friend, one should not greet him with good morning, even if one already said Brachot HaShachar.




That article also lists the original sources, primarily from Mishnah Brurah


tefilla - Titkabbel vs. Titkabbal


In קדיש תתקבל, most Ashkenazi siddurim I've seen say "תִּתְקַבַּל." ArtScroll, however, has "תִּתְקַבֵּל." Why did this difference arise?




halacha - Bootstrapping problem: havdalah ends shabbat (for one who didn't daven ma'ariv) but lighting the candle is melacha?


This answer (originally elsewhere, later merged here) to a question about melacha before havdalah notes that in that situation one should say "baruch hamavdil bein kodesh l'chol" first. Does that apply to lighting the havdalah candle? I have never learned that women who don't daven (pray) ma'ariv, but who make havdalah themselves, should do anything special first before lighting the candle, but isn't lighting the candle melacha? Should a woman who makes her own havdalah always say "baruch..." first and then proceed with havdalah? Or does melacha that is required for havdalah have some special status that makes this not a concern?



Answer



Yes. Women should formally end shabbat before lighting a havdala candle after shabbat has ended, i.e. after nightfall on Saturday.


First of all, women certainly can daven maariv and say attah chonantanu.


Second, the Rama in OC 299:10 quotes an opinion that the only reason labor is forbidden before havdala is lest one forget to say havdala. Accordingly, one could do non-labor intensive work immediately after shabbat, including lighting a candle. The Rama suggests that this opinion is why many are lenient regarding the prohibition on labor before havdalah. However, he and many later poskim hold that the halacha should not be in accordance with this view, and it would thus be proper to recite maariv or 'baruch hamavdil' before lighting the havdala candle.


Additionally, the Be'er Heitiv (on the page there) advocates teaching the women (who at the time were largely uneducated) to refrain from lighting candles until formally ending shabbat.


halacha - Humming as an interruption during Birkat Kohanim


Is the humming by the kohanim during birkat kohanim considered a hefsek of their bracha? Please be clear what halachik reasoning allows or disallows this humming.



Answer



The Mechaber rules (OC 65:1) that if someone pauses in the middle of a mitzva an amount of time in which he could have performed the entire mitzva (henceforth: a long pause) he does not have to start over with the exception of Tefillah (ie Shmoneh Esrei) where one would have to go back. The Rama rules that for deoraita requirements, one would have to go back if the pause was forced (באונס) and not voluntary. For derabanan requirements he would allow one to not go back, per the Mechaber, and make one always go back for Tefillah, also per the Mechaber. (All the above is as explained in Biur Halacha to OC 65:1 sv Kar'ah.) The amount of time sung by the Kohanim is IMO definitely longer than the time it would take to just say all three pesukim responsively.


So we have three issues:


1) Is this singing considered a forced interruption? The Magen Avraham quotes two opinions if forced means that one was halachically unable to continue (eg. something unclean passed nearby) or if one was practically unable to continue (eg. armed robbers passed nearby). He seems to side with the former definition while our case would seem to be more similar to the latter (the Kohein could go ahead and say the final word loudly while everyone else was singing, I suppose).



2) Does Birkat Kohanim count as Tefillah and would therefore need to be restarted even without a forced long pause for the Rama? So I can't say for sure, but it wouldn't surprise me at all if it were. Consider the full name of the Rambam's section: הלכות תפילה וברכת כוהנים‏. Birkat Kohanim is said as part of Shmone Esrei, and utilizes the Chazzan and Minyan to do so. The Mishna in Rosh Hashana 4:5 even calls the last Bracha of Shmone Esrei (about peace) "Birkat Kohanim". So the two are closely related. I'm not sure though if that carries over into the laws of Hefsek or not.


3) Does the length of time to say all of Birkat Kohanim include the singing, since that is the custom? The Biur Halacha there mentions this as a possibility but leaves the matter for further study (צ"ע). I don't get the feeling he is particularly convinced by this option.


So if you assume Birkat Kohanim is not Tefillah and you either hold like the Mechaber or hold like the opinion that this type of case is not considered forced, then even if you hold the time spent singing does not combine to the action's length you would not have to go back and restart Birkat Kohanim for singing too long.




All this is at least on a bedieved level. The Aruch haShulchan (OC 65:5) writes that for sure in all cases one should not make such a long break lechatchilah and it is only permitted to do so for great need.


Does Birkat Kohanim count as great need, ie can a Kohen go up if he knows singing will take place? Well, it is a mitzva deoraita, but on the other hand, if a he were to leave the Minyan before the start of the 3rd to last blessing of Shmone Esrei (Retzei...) he would not be obligated in this mitzva, so no loss. CYLOR for a final ruling.


Does reciting the prayers regarding dreams count as a great need, ie should a shul abolish the minhag of singing? Well, it is an old minhag, and the dream-prayers date back to at least the Gemara (Brachot 55b), but on the other hand see the Levush OC 128:26 who records the minhag of the Kohanim singing "the ך in וישמרך, the ך in ויחנך and the ל in שלום [because that way they have finished the bracha at hand (groan)]" thereby avoiding extended pauses. CYLOR for a final ruling.


parashat bereishit - Plants before the Sun in the Order of Creation


Why does plant life precede the Sun in the order of creation given that plants need the Sun to do photosynthesis?




Friday, 25 March 2016

verbs - aru vs iru : Why is aru in "Watakushi-wa untenshu-ga aru" (私は 運転手がある) unacceptable?


There is a generally expressed rule in Japanese that, when declaring existence, いる is used for animate subjects, and ある is used for inanimate subjects. There are some interesting variations in what is considered to be animate, but there's one very well known exception to these rules.



私は子どもがXある - I have X children/As for me, there are X children.




いる is preferred in this sentence, but ある is permissible. I have heard the acceptability of ある in the above explained in two ways.



  1. Children are "de-personified" in this structure, either because of linguistic humility or some other reason. In this case, intransitive ある maintains the usual distinction of working only with inanimate/non-moving subjects.

  2. This is actually a different ある verb from the existence variant. In this case, ある is a transitive possessive verb meaning "to have, to own".




Either of these explanations will work, but moving outside of this specific sentence presents me with a problem.


I have recently read that




×私は運転手がある



is not acceptable, even if 運転手 refers to a permanent servant working for the 私 in the above sentence. Why is this?


I would think it would be at least as acceptable to de-personify one's own servants as one's children. Rather obviously explanation 2 (possession) should allow this construction as well. What distinguishes these two uses of aru?



Answer



As noted in the comments, we all agree that 私は子供がいる is the usual way of saying you have children. The question is why is 私は子供がある permissible, but 私は運転手がある is not?


The verb ある can be written as 有る or 在る. The first is the one used in the rule "use 有る for inanimate objects and 居る for animate beings" and means "being (t)here". The verb 在る, like its 漢語 incarnation 存在, means existence and has a more essential flavour to it than a just being there. With more 漢字, the first sentence should thus be written 私は子供が在る.


This existence is closely tied to the person in question (私) in a way that the driver (運転手) is not. Thus one can say


彼は[田舎]{いなか}に[親戚]{しんせき}が在る。


but not 私は運転手がある, because the existence of your driver is not tied to you in such an inextricable way. You can change your driver, or fire him, in a way you cannot change (or fire) your children. (Well, you can fire them legally, by giving them free for adoption, but you cannot fire them biologically.)


Thus, it is just about possible to say


ブルース・ウェイン(ウェイン家)はアルフレッドと言う[忠実]{ちゅうじつ}なバトラーが在る。

because the butler's existence is tied to the Wayne family much like a family member.


Side note: (Judge for yourself, whether this is at all related to the question or to the answer.) Looking at the negation of ある, ない, we also have different 漢字, i.e. 無くなる and 亡くなる. As a negative analogue of the ある/いる rule above, we have the rule "use 無くなる for inanimate objects and 居なくなる for animate beings". The expression 亡くなる, however, is used for the verb "to die", but can also mean "to perish" or "to cease from existence" and is thus the perfect candidate for the negative of 在る, when used in the phrase 親戚が在る; you have (在る) relatives, until you don't have (亡い) relatives, because they die (亡くなる). If your relatives moved into town, you have to say that


[親戚]{しんせき}は[田舎]{いなか}から居なくなった。今[都会]{とかい}に[住]{す}んでいる。

acid base - Is methanol really more acidic than water?


The question Why is methanol more acidic than water? deals with the reasoning of why methanol is more acidic than water. However, as mentioned in the comments of that question, the acidity constant of water is $14.0$, as confirmed by two sources$^{[1][2]}$, with one of them offering a very convincing explanation. The Wikipedia page$^{[3]}$ for methanol quotes its acidity constant to be $15.5$.


So it would seem, water is more acidic than methanol. But an answer to the question mentioned above gives a good reasoning for why methanol is more acidic than water (it doesn't deal with the pKa of water, though). Also, the answer mentions that water would be much worse an acid in DMSO. Another question implies that methanol and other alcohols are more acidic than water.


On the other hand, it is also true that we regard alkoxide ions as being more strongly basic than the hydroxide ion (thus we use them primarily for elimination reactions).


This leaves us in a fix. So what is the ultimate truth?




[1]: What is pKa of water? - Chemistry ChemLibreTexts
[2]: Water (Data Page)

[3]: Methanol



Answer



First, water's $\ce{pK_a}$ in water is $\ce{14}$ as explained here. This means that $\ce{H2O}$ is slightly dissociated in liquid form, such that $\ce{[H+] = [HO-] = 10^{-7}}$.


Second, I would say that caring too much about which compound is the best acid is a bit like arguing by definition. Acidity is a fuzzy concept used as a shorthand for deeper meaning. This means there is little point arguing about the shorthand when we have the actual properties it synthesizes.


In this case (sou rce):


$$ \begin{array} {|c|c|c|l|} \hline \ce{solvent} & \ce{pK_a\ of\ water} & \ce{pK_a\ of\ methanol} & \ce{Interpretation} \\ \hline \ce{water} & 14.0 & 15.5 & \ce{water\ is\ more\ dissociated\ than\ methanol} \\ \hline \ce{DMSO} & 31.4 & 29.0 & \ce{methanol\ is\ more\ dissociated\ than\ water}\\ \hline \end{array} $$ So you can argue (as in the answer you linked) that methanol is more acidic than water in the abstract sense, because $\ce{DMSO}$ doesn't stabilize the anions by hydrogen bonding and so is closer to the "ideal" case (whatever that may be).


But what's the point ? You already have the $\ce{pK_a}$ values, any practical question you might have about the concentrations of theses solutes in $\ce{H2O}$ and $\ce{DMSO}$ is already answerable.


grammar - "slightly/somewhat" の 「~[目]{め}」: Usage and limitations



I'm somewhat confused about the usage and limitations of the ~め suffix that means "somewhat/slightly". I've only ever heard it on a handful of words:




  • 大きめ

  • 小さ目

  • 多め

  • 少な目

  • 早め




and maybe a few others that I can't recall at present.


1) Can these be used with any イ-adjectives, or only certain ones?
2) Can they be used with ナ-adjectives at all? Can't say I've ever seen one.
3) What are the limitations of its usage? For the イ-adjectives, is ~めに interchangeable with ~く for forming the adverb?
4) などなど



Answer




  1. Yes. There seems to be no limitation on the combination of i-adjectives and .

  2. Yes. For example, 静かめの曲



  3. It is not interchangable. As you already wrote in the question, weakens the attribute expressed by the adjective. Therefore, the adverbial usage ...目に will in general be a weakening of the adverbial usage of ...く.




    • 早く走った 'ran early'

    • 早めに走った 'ran somewhat early'





  4. ???





estimation - Amplitude Estimating Using a Windowed DFT


Let's say we want to estimate the amplitude A of a mono-frequent signal using a windowed DFT. The frequency of the signal is unknown, and the frequency resolution of the DFT is limited, thus it cannot be expected that there is a DFT bin that matches this frequency directly. Therefore, A is estimated from the amplitude of the next closest DFT bin. Now the question is,


should the frequency response of the window exhibit a narrow or a wide mainlobe to obtain a good estimate, and why?




tefilla - Minyan, netz hachamoh, and precision in time



There are halachic sources that discuss the importance of davening shemona esrei at netz (at sunrise), some of which state that it is preferable to daven at netz over davening with a minyan (at least for those accustomed to davening at netz).


When davening with a minyan around netz, how precise do we consider the categorization of "davening netz?" In other words: Do we attempt to be as arbitrarily precise as possible, or do we assume a margin for "visible netz," seeing as historically they didn't have the same ability to keep time during the gemara?


In terms of practical application, would it be preferable for one to start davening shemona esrei at netz even if it entailed lagging behind or running ahead of the minyan they are presently attending?




filters - Minimum Sampling Rate of Bandpass signal


Consider a DSBSC signal s(t) = m(t).cos(2.pi.20k.t) where say m(t) is multi-tone signal with frequencies less than 5 kHz.


The spectrum gives a typical bandpass say triangle centred around 20k and -20k. Now, when I calculate the minimum sampling rate;


Since the highest frequency is not an integer multiple of bandwidth of the bandpass signal; I end up getting the sampling rate as 25 KHz.


But when I draw the spectrum for the sampling rate of 10 kHz, the message signal centred at origin was doubled in amplitude and there was no aliasing as well.


Does that mean the minimum sampling rate is indeed 10 kHz?


I have used the typical bandpass sampling rate procedure many times, this was the first time it failed in giving me the minimum sampling rate!


edit: I doubt that the 10 kHz would be the minimum sampling rate to recover the message signal while the bandpass sampling rate of 25 kHz is the one which recovers the bandpass spectrum!



Also, if the above conclusion is correct, is it independent of the carrier frequency (Fc>>Fm)?




minhag - Can one say "Hazak u'Baruch" to both men and women? If not, is there a female equivalent?



When returning from an Aliyah la'Torah, I am commonly met with "Hazak u'Baruch". I have encountered this saying in other situations when someone does something praiseworthy.


Can one say "Hazak u'Baruch" to both men and women? If not, is there a female equivalent?



Answer



Perhaps Hazaka u'vrucha? Haven't heard it said before though, and i'm not even sure if thats grammatically correct


women - Is there a feminine equivalent of Zt"l?




Inspired by this question, I am wondering:


Is zt"l -- זצ“ל, zatzal = zecher tzadik livracha "May the memory of this tzaddik be a blessing" -- ever used for tzadkaniyot, righteous females? Or else is there another honorific that is used for them?



Answer



If you search Google for "Mrs. * ZT-L", you'll find many instances of this honorific used for couples, and a few for women. Here are some examples of it used for women by various Jewish news or public relations outlets:



BaltimoreJewishLife.com regrets to inform the community of the petirah of Mrs. Chaya Bobrowsky, zt’l, grandmother of Reb Yoni Adler.



- "BDE: Mrs. Chaya Bobrowsky, zt’l, Wife of TA's Venerable Rebbi, Rabbi Yaakov Bobrowsky", BaltimoreJewishLife.com, March 22, 2016



Generation Sensation was created in honor of Rebbetzin Leah Raichik ZT”L, the first shlucha of the Rebbe in California, and Mrs. Miriam Weiss ZT”L, a pioneer of the Los Angeles frum community, who both have grandchildren and great-grandchildren enrolled in Bais Chaya Mushka.




- "Event Honors Moms, Bubbies", COLlive Community News Service, May 14, 2015



The proceeds from the dinner, as well as the commemorative journal saluting the school and the honorees, will go directly toward the Sarah Rivkah Lander Chesed Fund, established by the Lander family. Mrs. Sarah Rivkah Lander, zt”l, was a vital partner in the historic achievements of her husband, Touro Founding President Dr. Bernard Lander, zt”l.



- "Lander College for Women Celebrates 40th Anniversary", Lander College for Women News and Events, July 2, 2014


I think it's fair to conclude that while this honorific is probably used a great deal less frequently for women than it is for men, its use for women is not unheard of.


halacha - Bracha on seeing indirect light from lightning?


As this question mentions, one should say the bracha if the sky lights up, even if one does not see the bolt.


What if one is facing away from the window when lightning strikes and the light fills the room? Does this count as seeing lightning?




chol hamoed - How do you violate the intermediate days of the festivals?


The Talmud (Sanhendrin 99a) states:



He who defiles sacred objects, he who violates the intermediate days of the festivals, or he who embarrasses another person in public, even if they are learned in Torah and have done many good deeds, lose their portion in the eternal world.




Defiling sacred objects and embarassing others is pretty clear, but how exactly do you violate Hol Hamoed (intermediate days of the festivals)? The primary days of the festivals have the 39 melachot (except cooking), but the melachot don't apply during Chol Hamoed!




organic chemistry - Why is sodium acetate a good nucleophile?


As $\ce{CH3COONa}$ is bulky, I thought that $\ce{CH3COONa}$ is a weak nucleophile. But I found out that it's a nucleophile good enough to perform $\mathrm{S_N2}$ reaction on a secondary carbon.


Why is it so?



Answer



The acetate anion is actually not particularly bulky. The negative charge is located on the two oxygens which are approximately at a $120^\circ$ angle away from the only residue that has the potential to be bulky. Whatever that residues does will be ‘behind’ the carbon and hardly noticeable. However, they are still rather bad nucleophiles since the negative charge is delocalised over two oxygen atoms in the π system.


I’m actually not sure which orbital attacks nucleophilically but it could equally be an oxygen lone pair rather than the π system. If that is the case, there is really very little steric hindrance that could inhibit the reaction from proceeding. Thus, acetate is able to attack nucleophilically, as it does for example in a Mitsunobu reaction.


metal - Why is copper a better conductor than iron?


So metals are good conductors as the electron in their outer shell is loose and can plunge out of the atom with the application of the slightest force(voltage).


Silver is the best metallic conductor, then comes copper.


But my question is- Why is one metal better at conduction than the other one? What determines the difference in conduction between 2 metals?


Why is silver a better conductor than copper, and why is copper a better conductor than iron if all of them have loose electrons?




Thursday, 24 March 2016

passover - How much is 2 Zuz worth in current USD?


As mentioned in the Passover Hagaddah, how much is "2 Zuz" worth in March 2013 US Dollars?


Please note there may be different types of Zuz: "זוזי פשיטי" and "זוזי ממש" (Ketuvot 67a).
This may be the Zuz in question: link .


This Aish.com article appears to imply 2 Zuz is worth $7.50:


But that seems cheap for a little goat, even one that can be eaten by a single cat, which can be easily bitten by a dog, which was doing the right thing in defending the goat and didn't deserve to be beaten by a stick, which deserved to be burned by the fire, which... you get the idea.



So what's 2 Zuz worth? How much did this baby goat go for in USD?




lowpass filter - Fast Integer 8 Hz 2nd Order LP for Microcontroller


I need an 8 Hz 2nd order LP filter. It does not have to be terribly accurate but it should be 2nd order-ish. Performance is much more important.


My sample rate at the moment is ~9.5 kHz. The filter should have a Q of 0.707 but again accuracy is not paramount.


I have been looking at biquad filters but this is for a little 8 bit microcontroller. It has floating point emulation but my understanding is that it's 10x slower. So I think 32 bit integers are about as far as I want to push it. Trying to do an 8 Hz biquad using 32 bit integers could prove difficult.


If I understand correctly these filters as just summing sample values multipled by some coefficient at different taps in a delay line so it seems to me there should be a way to implement a relatively simple filter by picking 3 taps and 3 integer coefficients and then use a divisor at the end of each step to give me a stable running value.



Does this make sense? If yes, can someone recommend a design procedure? I think I have GNU octave on my machine.


UPDATE 1:


While Dan's description of a moving average filter is very interesting, I believe it would be fobidden in my particular application.


In short, I'm creating an LED VU meter. Yes, it is trivial to make an LED meter that will give the operator an indication as to the level of a signal and it might even be easy to make it vaguely accurate. Currently my implementation uses a simple running average and it works.


However, being the obsessive compulsive type, I have taken an interest in how mechanical VU meters actually work and someone directed me to a paper on the topic "A model of the VU (volume-unit) meter, with speech applications" Lobdell 2006. According to the paper, the procedure is fairly simple:


full wave rectify -> 8 Hz 2nd order low pass -> scale -> log convert


That someone also specifically rejected the idea of using a moving average filter because it would not yield accurate results with all frequencies being metered.


So I think I will need to implement a proper biquad.


But it has been impressed apon me by the great answers posted here as to the importance of reducing the sampling rate (decimation). Unforunately again, the decimation method cannot be a running average. It must be a time domain calculation to properly represent the energy of all frequencies being metered.


UPDATE 2:



When I do this (Octave / Matlab):


clear all;
close all;

N = 4096;
Z = 16;
A = 256

m = [];


for mi = 1:A
ip=round(rand(N,1)*512);
op=[];
rval = 0;
for i = 1:N
rval = (rval * (Z-1) + ip(i)) / Z;
if mod(i, Z) == 0
op = [op rval];
end
endfor


op = fft(op,N/Z);
m = [m; abs(op(2:N/Z/2))];
endfor

x = [2:N/Z/2];
y = mean(m);

semilogx(x,20*log10(y))


I get this:


moving average filter


There are no notches in the response as long as the decimated sample rate is the same as the moving average window size (meaning window size is also modulus in test to save sample). If it's not exactly the same, I do get horrible notches in the response.


So this is good. Is this what you (Dan) meant by how things would "fold" together? Near as I can tell the slope is about 3 dB / octave so if I do 4 passes that's a not terribly accurate fast integer 2nd order LP.


Can I depend on this behavior when translated to fixed-point math?


UPDATE 3:


I now have a 12db / octave filter. I decimated by a factor of 16 to reduce the sample rate to ~600 sps and used a basic 2nd order biquad:


clear all;
close all;


N = 4096;
A = 8;
Fs = 9500;
T = 1/Fs;
t = 0:T:(N-1)*T;
f = Fs*(2:(N/2))/N;

% decimated values
Z = 16;
dN = N/Z;

dFs = Fs/Z;
dT = 1/dFs;
df = dFs*(2:(dN/2))/dN;

m = [];

for mi = 1:A
ip=round(randn(1,N)*512 + sin(2*pi*100*t)*256);
op=[];


n = N;

rval = 0;
v0 = 0;
v1 = 0;
v2 = 0;
for i = 1:n
rval = (rval * (Z-1) + ip(i)) / Z;
if mod(i, Z) == 0
v0 = v1;

v1 = v2;
v2 = (87 * rval - 27191 * v0 + 59613 * v1) / 32768;
tmp = (v0 + v2) + 2 * v1;
op = [op tmp];
end
endfor

n = length(op);

op = fft(op,n);

m = [m; abs(op(2:n/2))];
endfor

y = mean(m);

semilogx(df,20*log10(y))

However, with 4096 samples I get this:


biquad lp 4096 samples


and with 65536 samples I get this:



biquad lp 65536 samples


as you can see the magnitude is drifting. Does this mean the filter is not stable?


How can I stablize it?




theology - What overlap is there between the attributes of God in Judaism and the attributes of God in Christian classical theism?



I'm Catholic, not Jewish, but I've always been curious about Judaism. Especially seeing as the Old Testament is largely the same as the modern Jewish bible (with the exception of the deuterocanonical books). I've wondered many times how the Jewish interpretation of the scriptures differs to the Catholic interpretation. Thought I'd start asking questions here and get informed!


I'm wondering what is the Jewish understanding of God. In Catholicism God is said to be simple, which means that God has no parts and is identical to his attributes and his attributes are identical to each other. So for example, we say that "God is love" and "love is God" and "God is justice" and "justice is God" and therefore "God's love is the same thing as God's justice". Is it the same situation when it comes to understanding God in Judaism?


Also do Jews believe in the Creatio ex Nihilo? Which is to say that God created the universe "out of nothing". It also implies that God is completely and utterly unlike the universe. He sits outside it and holds it in existence by his creative powers moment by moment, and if he were to withdraw those creative powers the universe would simply cease to exist. Or do do Jews believe in a pre-existing universe which God lives within, filled with pre-existing matter which he shaped into what we see around us. Or perhaps Jews believe in Deism? Such that God created the world out of nothing and then sat back and let the world carry on doing it's own thing, and he created the world such that it does not require his continuous creative effort in order to remain in existence?


In Catholicism, God is said to have no gender, strictly speaking. It is not correct to refer to God as "He" or "She", but we do this out of convention and tradition, because God is said to have both masculine and feminine aspects, but we have always emphasised the masculine. Is this the same in Judaism?


The more general question that I'm trying to ask is, what is the nature of God in Judaism? What are his attributes?




handwriting - What do you do if a genkoyoshi line ends with e.g. す。」?


Suppose that you're writing on genkoyoshi (原稿用紙), and you are writing a quotation, e.g.



「これはペンです。」



And let's say that each line of the genkoyoshi has 8 blocks. The first block would, I presume, be occupied by , followed by one block for each of the kana .


What do you do with the rest of the quotation? My understanding is that you're not supposed to put punctuation at the beginning of a new line, so you can't split it and 。」, nor す。 and . Do you just glom all of す。」 into a single block?



(Or do you just never include a immediately prior to a closing ?)



Answer



According to 非回答者



Cram all three into the bottommost block -- "す。」". The better schools, teachers and publishers will not accept any other method.



halacha - Gun control in Judaism



In light of recent terrible acts committed that involved guns. What is the Torah perspective on gun control. Are there any Torah sources which discuss gun control from a halachic/hashkafic point of view. Is there such a value at all?


What I mean by gun control I mean to say the arguments given to curtail their proliferation or doubts regarding the right to own a gun as an inalienable right. Is there anything for such curtailing or against such curtailing in Halacha or Hashkafa?


Given the nature of the question and the slim chance that Halachic books talk explicitly about gun control, answers may be personal opinioned but must be based off traditional Torah sources.



Answer



Shulchan Aruch C.M. 409:3 says:



אסור לגדל כלב רע אא"כ הוא אסור בשלשלאות של ברזל וקשור בהם ובעיר הסמוכה לספר מותר לגדלו וקושרו ביום ומתירו בלילה


It is forbidden to raise harmful dogs unless he chains them with iron chains. In a border town it is permitted to raise them and chain them by day and let them loose at night.



The Biurei HaGra explains this is limited to Israel, but the Ramo goes on to include the limitation outside if the dogs are potentially harmful to people. The purpose of putting them in chains (in the latter case) includes preventing them from scaring pregnant women (מאירת עינים there), so the chaining has to be obvious, not just effective.



The analogy to gun control seems fairly obvious. Permitted for self defense, even in ways which have some theoretical possibility of harm (at night in a border town), but otherwise precautions must be taken to prevent accidental harm to others. There was, however, no decree to outright ban them.


In addition, in terms of sales (analogous to background check requirements, I guess) Avoda Zarah 15b says it is forbidden to sell, make or fix weapons for someone (Jewish or not) who one is concerned will use it for murder.


In terms of "inalienable rights" Judaism doesn't have (to my knowledge) any Halachic or Hashkafic approach which worries about Government encroachment and tyranny. However, one of the rights recently recognized in the second amendment is self defense (the recent DC vs. Heller decision), and this is recognized in Judaism not as a right but as an obligation, about oneself as well as in defense of others. (Sanhedrin 72a and 73a respectively).


Some of these same sources and additional ones are discussed in this article by Rabbi Shlomo Yaffe and he uses them to apply some thoughts to gun control, including the Ramban on Bereishis 4:20 which discusses the "guns (swords) don't kill people, people kill people" slogans you hear every once in a while.


food - May a man eat meat if attending the siyum of a woman?


The Rema on the Shulchan Aruch states that if one partakes of a seudat mitzvah such as a siyum then a person may eat meat or drink wine during the nine days. I would like to know if any poskim speak about whether or not a man who attends a siyum made by a woman may similarly eat meat and drink wine.


I am unsure if the principle that a person who has a lesser obligation (in this case women learning torah) cannot exempt someone who has a greater obligation (man learning torah) would apply here.





minhag - Selichot origins


In what year (CE) did saying selichot in Elul begin? In what year were they made a standard addition to prayer books? Looking for an academic answer, not the yeshivahish one. And did Sephardim start doing it before or after Ashkenazim?




Wednesday, 23 March 2016

loanwords - Katakana words with Kanji. How did that happen?


Some words are written with katakana, but also have kanji. For example:



  • コーヒー 珈琲

  • ページ 頁



How did this happen? They are loanwords, but no doubt had Japanese equivalents before these variants were imported. Is that the case? And are these original words now forgotten?



Answer




had Japanese equivalents before the English variants were imported



Coffee is not native to Japan, and did not have an equivalent; that kanji sequence is ateji.


"Page" is that kanji, but it's properly pronounced 「けつ」 in sequences.


acid base - Does H3O+ donate a H+ to Water?


Does the hydronium ion donate a proton to water? If the collision of 2 molecules of water can cause a proton to be transferred, does hydronium 'pass' a proton to water?



Answer



$\ce{H3O^+}$ is really just a "shorthand notation" for what really occurs in solution. Typically higher hydrates of the proton, particularly $\ce{H5O2+}$ the "Zundel" cation and $\ce{H9O4+}$ the "Eigen" cation are thought to be the main players in the proton transfer process. As permeakra has pointed out, Grotthuss was one of the early pioneers studying this process and his name is still used to describe the mechanism. The mechanism is still an active area of research with considerable controversy remaining over the details of the mechanism. This reference provides some diagrams of the general process.


enter image description here


Basically, just as electrons are said to use a "hopping" transport mechanism, the same has been said of proton transport. The making and breaking of hydrogen bonds, accompanied by the twisting and turning of protons completes the process. This proton hopping mechanism between these larger water aggregates is thought to be a key step at room temperature. However proton tunneling plays a role as well, particularly as the temperature is decreased.


organic chemistry - Difference between backbonding and hyperconjugation and conjugation




What is the difference between backbonding and hyperconjugation and conjugation? I mean the basic differences as all are concerned with donation of electrons. What is the most striking effect of each that differentiate them from others.



Answer



OK, let's step through these terms and let's add "cross-conjugation" and "homoconjugation" for good measure to round out the series.



Backbonding:


This term is most often used to describe a type of bonding that occurs in inorganic compounds. Metals bonding with carbon monoxide provide good examples of backbonding. The carbon atom in carbon monoxide has a lone pair of electrons that can be used to form a sigma bond with a metal. Because carbon monoxide has low-lying $\ce{pi^{\ast}}$ orbitals, it can accept electrons back from the metal and further strengthen the bonding between the metal and the carbon monoxide ligand. This process of "accepting electrons back from the metal" is termed backbonding. Here is a good picture of the $\ce{\sigma}$ and $\ce{d-pi^{\ast}}$ (backbonding) bonding interactions.


enter image description here


It happens most often when 1) the metal is electron rich, 2) the ligand has low-lying $\ce{pi^{\ast}}$ orbitals and 3) the metal has available a $\ce{d}$ orbital with the proper symmetry to overlap constructively with the carbon monoxide $\ce{pi^{\ast}}$ orbital. Here is a link to a great, one page article on backbonding if you'd like to read more.


Hyperconjugation:


This term is most commonly used in discussions about resonance. Hyperconjugation is a stabilizing interaction that results from the interaction of the electrons in a σ-bond (usually C-H or C-C) with an adjacent (empty or filled) p-orbital. This interaction creates an extended molecular orbital that increases the stability of the system. Most typically it involves the breaking of a carbon-hydrogen bond and then using what were the $\ce{C-H}$ bonding electrons to stabilize an adjacent charge. In resonance structures, we can't move nuclei, but we can move electrons. For example, below is a diagram showing resonance structures that involve hyperconjugation that serve to stabilize the n-propyl carbocation. Hyperconjugation has been used as part of the explanation for the carbocation order of stability being tertiary > secondary > primary.


enter image description here


Recently it has been suggested that hyperconjugation, rather than steric effects, is what stabilizes the staggered conformation of ethane (very interesting!). Here is a link to a fairly extensive, but very well written article on hyperconjugation, it covers the effects of hyperconjugation on resonance structures and conformational stability.


Conjugation:


This term is used to describe a system of continuous, overlapping p-orbitals where electron delocalization can occur. Examples of conjugated systems include the 1,3-butadiene, acrolein, benzene, beta-carotene, etc.



enter image description here enter image description here


Cross-conjugation:


Sometimes you'll hear the term "cross-conjugation" used. In this case, the continuity of the overlap between the p-orbitals does not follow a simple linear pattern as seen in the examples of conjugation pictured above. Benzophenone and 3-methylene-1,4-pentadiene are examples of molecules with cross-conjugation.


enter image description here


enter image description here


Homoconjugation:


Sometimes p-orbitals that are not directly conjugated (e.g. that are not directly connected, there is a "spacer" in between them) can still interact or overlap in a "through space" fashion. The solvolysis of the exo- and endo-norbornenyl chlorides shown below provides a striking example. The exo isomer generates the corresponding carbocation thousands of times faster than its endo isomer. This difference is attributed to homoconjugation. The p-orbitals on the remote norbornenyl double bond can interact through-space with the developing p-orbital that is being formed on the carbon where the exo-chloride is leaving from, dramatically stabilizing the formation of the resultant carbocation. This interaction is geometrically impossible for the endo isomer. Again note, there is no direct conjugation between the remote double bond and the carbon atom where the carbocation will form, it is entirely a through space interaction that generates a pseudo-allyl system.


enter image description here


readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...