Friday, 27 March 2015

downsampling - What is anti-alias pre-filter for preventing aliasing after under-sampling?


We know that the under-sampling results in aliasing and frequencies higher than half of the Nyquist rate is not distinguishable. I've a base band signal that I want to use the higher frequencies which are higher than the half of the Nyquist rate (Nyquist frequency) as well as low frequencies(all parts). I've a special process with this path:



$$\textrm{Input}{\longrightarrow}\boxed{\textrm{anti-aliasing pre-filter}}{\longrightarrow}\boxed{\textrm{decimate}}{\longrightarrow}\boxed{\textrm{FFT}}{\longrightarrow}\boxed{\textrm{tune on special part}\\{\textrm{of the signal}}}$$


The low-pass post-filter that people usually use as anti-aliasing filter removes the high frequencies that are of interest for me. What is the digital or analog anti-aliasing pre-filter that I don't lose high frequencies.




particle は - は significance in ゲームは上手いですね


I'm confused by the reaction to は in this exchange



A:「ゲームは上手いですね!」
B:「ゲーム「は」.....」



source context: http://neetsha.jp/inside/up/1/2/12840/24.jpg




Answer




A:「ゲームは上手{うま}いですね!」


B:「ゲーム「は」.....」



This is the contrastive 「は」 or at least that is what B takes it to be.


A's line can be interpreted as "You are good at games (if not anything else)!", which is exactly how B interpreted it. That is why B reacts (jokingly) by emphasizing the contrastive 「は」.


B's line is obviously difficult to translate literally as English has no such particles. In that sense, A's line is already difficult to translate to begin with.


Particles can be so powerful that this shortest exchange can stand as a valid joke in itself. (And this often takes place with the contrastive 「は」 in real life.) The 「は」 in B's line would receive much stress in actual pronunciation.


B could have also said:




「ゲーム『は』って・・・」


「ゲーム『は』かよ!」


「ゲームだけかよ!」



discrete signals - How to include phase in a sinusoidal Kalman Filter


I start with the equation for sinusoidal motion with an offset and differentiate to get the 2nd order ODE describing the motion of the object.


\begin{align} x &= A\sin(\omega t + \phi) + O\\ \dot{x} &= A\omega \cos(\omega t +\phi)\\ \ddot{x} &= -\omega^2 A \sin(\omega t +\phi)\\ \implies \ddot{x} &= -\omega^2(x-O) = -\omega^2x + \omega^2O \end{align}


In matrix form this becomes:


$$ \begin{bmatrix} \dot{x} \\ \ddot{x} \\ \dot{O} \end{bmatrix} = \begin{bmatrix} 0 & 1 & 0\\ -\omega^2 & 0 & \omega^2 \\ 0 & 0 & 0 \\ \end{bmatrix} \cdot \begin{bmatrix} x \\ \dot{x} \\ O \end{bmatrix} $$



$\implies$ the system dynamics matrix $\mathbf F$ is:


$$ \begin{bmatrix} 0 & 1 & 0\\ -\omega^2 & 0 & \omega^2 \\ 0 & 0 & 0 \\ \end{bmatrix} $$


then by performing $$ A(t) = \mathscr{\mathbf L}^{-1}\left(s\vec{\mathbf I} - \vec{\mathbf F}\right)^{-1} $$


I get the following discretised $\mathbf A$ matrix:


$$ \begin{bmatrix} \cos(T_s \omega) & \dfrac{\sin(T_s \omega)}{\omega} & -\cos(T_s \omega) + 1\\ -\omega \sin(T_s \omega) & \cos(T_s \omega) & \omega \sin(T_s \omega) \\ 0 & 0 & 1 \\ \end{bmatrix} $$


This works to filter a sine wave of a know frequency with an offset, it predicts the correct phase, amplitude and even if a change the amplitude of the signal being filtered half way in it corrects for this very quickly and fits to the true signal. However if I shift the phase of the true signal part way through it does not correct for it. How might I include phase $\phi$ in my Kalman filter model such that it can still track the signal with sudden changes in phase?


If I try with my current filter I get the following result:


Kalman filter trying to track a sine wave with a phase change



Answer



The answer is that the filter I detailed can correct for the phase, the issue was that the values in my Q matrix were too small and therefore it was overly trusting of the model and was correcting for the change in phase very slowly. By increasing the values in the Q matrix this model can quickly correct for the change in the phase of the oscillator!



The output now looks like the following:


Output of Kalman filter tracking the phase change


Thursday, 26 March 2015

fft - Plotting magnitude and phase for frequency spectrum



I would like to find the frequency spectrum by drawing magnitude and phase for the following signal:


S=sin(2*pi*100*t)+cos(pi*500*t);

X=sinc(2*pi*t);

Is there something particular to this problem that I should be noticing?


We can easily find the spectra giving a time domain like


t=0:0.01:0.1;

And using the fft command for both signals



X=fft(S);

What did they mean by drawing the magnitude and phase?




particles - What's the difference between -ga and -o when they are used to designate a direct object?


During the past month I've been addicted to Japanese. I've listened to about 10 online tutorial video courses and read about as much printed lessons. I am determined to learn Japanese, but I am really a newbie so my question may be very basic, but please bear with me.



If I understand correctly, both -ga and -o particles designate a direct object. For example, I've heard:



Watashi wa ongaku-ga suki desu. = I like music


Watashi wa ongaku-o kiku (or kikimasu, I'm not sure) = I am listening to music



So why is it ga in one case and o in the other? Is it specific to the verb or the object or what?


P.S. I don't know hiragana yet, so I'd appreciate if you could keep your examples, if any, in romaji.



Answer



It depends not only on the verb, but on the form of the verb.


The general rule is that static verbs and adjectives take "ga" and "action verbs" take "o" on the direct object.




piano-o hiku
play the piano


piano-ga hikeru
can play the piano



Here, playing the piano is an action, thus "o" is used. Being able to play the piano is a state, thus "ga" is used.



ringo-ga hoshii
want an apple



ringo-o hoshigaru
act like you want an apple



Again, to want an apple is a state, so use "ga", to act like you want it is an action, so use "o".


grammar - Varying word order for stylistic effect


Sometimes, for stylistic or rhetorical effect, one wants to delay mentioning a word/concept until the end of a sentence. For example, it's often best to save the punchline for the very end:



I was happy to discover that my ex was sentenced to life in prison for arson, murder, and jaywalking.



If we directly translate into a Japanese-style word order—




((My ex)-NOM (Arson, murder, and jaywalking)-for ((life in prison)-to sentenced) was) that I discover happy was.



—the utterance hemorrhages much of "jaywalking"'s comic effect into the bog of unnecessary background and framing information.


Whereas English word order naturally places the word where we want it, if we instead wanted to place it somewhere else, English makes available alternative or periphrastic phrasings, such as "x did y." → "It was y that x did."


So likewise: what techniques or periphrastic constructions are available in Japanese to move words or clauses?




linear systems - In the context of transfer functions, what is the relationship between the terms "proper", "causal", and "realizable"?


I am thinking about these terms in the context of linear control.


A transfer function is proper if the degree of the numerator is not greater than the degree of the denominator. I've read often that improper transfer functions are "not causal". I also often see the word "unrealizable" used often in this context.


If a control transfer function I've designed is improper, does that mean it is "causal" and/or "unrealizable"? What is the difference between these terms? What do they mean in practice?



Answer



Causality is a necessary condition for realizability. Stability (or, at least, marginal stability) is also important for a system to be useful in practice.


For linear time-invariant (LTI) systems, which are fully characterized by their transfer function, we get realizability constraints on the transfer function. For continuous-time LTI systems, if we work at frequencies for which the lumped element model is valid, we require the system's transfer function to be rational for the system to be realizable. Also for discrete-time LTI systems we require rationality of the transfer function, which implies that the system can be realized by adders, multipliers, and delay elements.


For an LTI system to be causal and stable, its poles must lie in the left half-plane (for continuous-time systems), or inside the unit circle (discrete-time systems). From this it follows that the rational transfer function of an LTI system must be proper, otherwise you would get one or more poles at infinity, causing the system to be unstable (or non-causal).


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 「ない...