Every content here is my original work.Creative Commons Licence
Universitas Scripta is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Your cookies may be used by Google and mathjax. See Google's privacy policy.
Showing posts with label IT. Show all posts
Showing posts with label IT. Show all posts

Saturday, 18 May 2024

Interpolation function training

Ideal interpolation kernel is sinc function, which consists of all frequencies upto Nyquist frequency. However, this involves infinite-dimension convolution in discrete calculation, so we apply window function. In signal procession, thus, interpolation kernel is windowed-sinc function [https://www.analog.com/media/en/technical-documentation/dsp-book/dsp_book_Ch16.pdf], and the window function can vary to achieve (1) to narrow the window width to reduce calculation, (2) and in the same time to increase accuracy and reduce artifacts. We have to satisfy these two contradictory conditions, so we have to compromise and optimise conditions.

    The kernel generally must satisfy f(0) = 1 and f(n != 0 but integer) = 0 and additionally I force to satisfy to be continuous function, to avoid catastrophic artifacts. Generic window function may be written in Fourier series, (cosine if symmetric) [https://en.wikipedia.org/wiki/Window_function] 

\[ \displaystyle
w(t)=
\begin{cases}
 \sum_{k=0}^{N}a_k \cos k \pi t  + \sum_{k=1}^{N} b_k \sin k\pi t\quad\text{if  \(t\in[-1,1]\)}
\\
0\quad\text{else}
\end{cases} \]

with absolute constraints

\[\textbf{Constraint 1: }\quad w(0) = \sum_{k=0}^{N} a_k = 1,\]

\[\textbf{Constraint 2: }\quad w(1) =\sum_{k=0}^{N}(-1)^k a_k = 0, \]

assuming the window width to be [-1, 1] (to use in practice, scale this in \(t\)-direction) .


Projection of the window parameters \(\{a_k, b_k\}\) to the constraints.

    From \(\{a_k, b_k\}\) vector space, we have two constraints to absolutely be satisfied. Analogously to this situation: we must project a point to two planes simultaneosly, thus making it on the line, the intersection of the two planes; The projection must move perperdicular to either plane. We can develop a training process only moving on the constraints, but because of calculation errors, we have to develop a way to project on the constraints anyway. The training process to optimise the kernel to the given big data of audio may correspond to the loss optimization process of this \((2N+1)\)-dimensional point moving to the minima or maxima.

    Let us concretise the projection idea more. The \((2N+1)\)-dimensional point always satisfy 2 constraints above, so the valid space satisfying the constraints is \((2N-1)\) dimensions. In the quotient space, the kernel corresponding to a certain point must be \(2\)-dimensional, which passes the given point and is parallel to the two perpendicular vectors of the two constraint \(2N\)-plane. The intersection between the proper \((2N-1)\) dimensions and the 2D-kernel is the projected point we want.

    The two perpendicular vectors is the same as the coefficients of the equations of the planes, so the 2D kernel including a point \(\{a'_k, b'_k\}\) is written by 

\[ \{a_k, b_k\}  = \{a'_k, b'_k\} + \{1, 0\} x + \{(-1)^k, 0\} y \]

To obtain the intersection of this kernel to the two constraints \(w(0), w(1)\), we may substitute the  \(\{a_k, b_k\}\) expression of the kernel to the equation of each constraint.

\[ w(0) = \sum_{k=0}^{N} (a'_k + x + (-1)^k y) = 1 \]

\[ w(1) = \sum_{k=0}^{N} (-1)^k(a'_k + x + (-1)^k y) = 0 \]

From these equations, we have to obtain \(x\) and \(y\) to obtain how much the intersection have moved inside the kernel space from the original point. Simplified,

\[ w(0) =(N+1) x + \frac{1 + (-1)^N}{2}y + \sum_{k=0}^{N} a'_k  = 1 \]

\[ w(1) = \frac{1 + (-1)^N}{2} x + (N+1)y + \sum_{k=0}^{N} (-1)^k a'_k = 0 \]

More simplified,

\[
\begin{pmatrix}
(N+1) & \frac{1 + (-1)^N}{2}
\\ \frac{1 + (-1)^N}{2} & (N+1)
\end{pmatrix}
\begin{pmatrix} x\\y \end{pmatrix}
=
\begin{pmatrix}
1-\sum_{k=0}^{N} a'_k 
\\
-\sum_{k=0}^{N} (-1)^k a'_k 
\end{pmatrix}
\]

\[
\Rightarrow
\begin{pmatrix} x\\y \end{pmatrix}
=
\frac{1}{(N+1)^2 - \frac{1 + (-1)^N}{2}}
\begin{pmatrix}
(N+1) & -\frac{1 + (-1)^N}{2}
\\ -\frac{1 + (-1)^N}{2} & (N+1)
\end{pmatrix}
\begin{pmatrix}
1-\sum_{k=0}^{N} a'_k 
\\
-\sum_{k=0}^{N} (-1)^k a'_k 
\end{pmatrix}
\]

\[\Rightarrow
\begin{pmatrix} x+y\\x-y \end{pmatrix}=
\dfrac{
  (N+1) -\frac{1+(-1)^N}{2} \mathrm{diag}\{1, -1\}
}{(N+1)^2 - \frac{1+(-1)^N}{2}}
\begin{pmatrix}
1-\sum_{k=0}^{N} a'_k -\sum_{k=0}^{N} (-1)^k a'_k 
\\
1-\sum_{k=0}^{N} a'_k +\sum_{k=0}^{N} (-1)^k a'_k 
\end{pmatrix}
\]

\[\Rightarrow
\begin{pmatrix} x+y\\x-y \end{pmatrix}=
\dfrac{
  (N+1) -\frac{1+(-1)^N}{2} \mathrm{diag}\{1, -1\}
}{(N+1)^2 - \frac{1+(-1)^N}{2}}
\begin{pmatrix}
1-2\sum_{k=0}^{N} \frac{1 + (-1)^k}{2} a'_k 
\\
1-2\sum_{k=0}^{N} \frac{1 + (-1)^{k+1}}{2} a'_k 
\end{pmatrix}
\]

Thus, the projected point \(\{a_k, b_k\}\) from the original point \(\{a'_k, b'_k\}\) is

\[
\begin{cases}
a_k = a'_k + x + (-1)^k y,\quad k\in[0,N],
\\
b_k = b'_k,\quad k\in[1,N].
\end{cases}
\]

\[
\displaystyle
\Rightarrow
\begin{cases}
a_k = a'_k +
\dfrac{
  (N+1) -\frac{1+(-1)^N}{2} (-1)^k
}{(N+1)^2 - \frac{1+(-1)^N}{2}}
\left(
1 -2\sum_{m=0}^{N}\frac{1+ (-1)^{k+m}}{2} a'_m 
\right)
\\
b_k = b'_k,\quad k\in[1,N].
\end{cases}
\]

    Thus, here we may define projection operator \(P\) s.t.

\[
\displaystyle
\begin{cases}
P(a_k) := a_k +
\dfrac{
  (N+1) -\frac{1+(-1)^N}{2} (-1)^k
}{(N+1)^2 - \frac{1+(-1)^N}{2}}
\left(
1 -2\sum_{m=0}^{N}\frac{1+ (-1)^{k+m}}{2} a_m 
\right)
\\
P(b_k) := b_k,\quad k\in[1,N].
\end{cases}
\]


Gradient vector projection to the constraints

Now, as doing projection each iteration of training is inefficient, we want to develop to project each step only on the constraints.

    From the original valid point \(\{a^0_k, b^0_k\}\) s.t. \(P(a^0_k\) = a^0_k, we want to consider new train step \(\{a^0_k + \Delta a_k, b^0_k + \Delta b_k\}\) where \(\Delta a_k, \Delta b_k\) may not be determined with constraints but only gradient of loss. Then, we must project \(P(a^0_k + \Delta a_k)\) to finalize the step.

\[
\small
\begin{aligned}
P(a^0_k+\Delta a_k) &= 
a^0_k +\Delta a_k+
\dfrac{
  (N+1) -\frac{1+(-1)^N}{2} (-1)^k
}{(N+1)^2 - \frac{1+(-1)^N}{2}}
\left(
1 -2\sum_{m=0}^{N}\frac{1+ (-1)^{k+m}}{2} (a^0_m + \Delta a_m)
\right)
\\ &= P(a^0_k) + \Delta a_k
-2
\dfrac{
  (N+1) -\frac{1+(-1)^N}{2} (-1)^k
}{(N+1)^2 - \frac{1+(-1)^N}{2}}
\sum_{m=0}^{N}\frac{1+ (-1)^{k+m}}{2} \Delta a_m
\end{aligned}
\]

    Thus, here we define the new projection operator \(\Delta P\) for the differentiation vector of the coefficient point:

\[
\Delta P(\Delta a_k) :=  \Delta a_k
-2
\dfrac{
  (N+1) -\frac{1+(-1)^N}{2} (-1)^k
}{(N+1)^2 - \frac{1+(-1)^N}{2}}
\sum_{m=0}^{N}\frac{1+ (-1)^{k+m}}{2} \Delta a_m
\]


Pseudocodes

\(P\) and \(\Delta P\) can be written in PyTorch codes:

Friday, 2 September 2022

Lightning to usb3 camera adapter review

 시중에 이미 많은 usb 킷들이 나와있지만 그래도 애플 정품은 전원부가 다를까 싶어서 구입해보았다. 예상 외의 부분들이 있었다.

우선 일반적인 써드파티 꼬다리보다는 확실히 전원부 품질은 좋았다. 중국산 lightning male to usb c female을 써서 dac를 연결했을때는 노이즈가 심해서 원래 dac품질의 문제로 생각했었다. 그런데 애플정품 젠더를 이용하니 노이즈 문제는 확실히 감소했다. 외부 전원 공급으로 인한 품질 향상을 기대했으나 폰 자체 전원만으로도 이런 차이가 있었다.

문제는 외부전원에 있었다. 외부전원공급시에 내가 기대한것은 전원 품질 향상과 용량확충이었다. 둘 다 문제가 있었다. 우선 외부전원을 연결하고 dac를 연결하니 한쪽 귀에서 노이즈가 들리고 전기가 튀기 시작했다. 아뿔싸. 역시 그라운드 루프 문제는 해결하지 못했구나... 특수장치를 쓰지 않는 이상 일반적인 경우는 다들 마찬가지일 것이다. 충전기에서는 flyback converter를 통해 허수전압이 연결된 chassis ground를 쓸 것이고, 이 전압이 폰 내부 gnd랑 달라서 전기가 흐른다. 도저히 귀가 아파서 쓸수가 없었다.

dac꼬다리 뿐 아니라, usb용 소형 거치형 dac도 연결해 보았으나, 전원이 아예 켜지지 않았다. 이것도 예상외였다. 보통 usb1은 100mA, usb2는 500mA, usb 3은 900mA의 전류공급을 보장한다. 하지만 lightning에서 audio accessory로 출력할수 있는 최대전류는 50mA, 순간최대 100mA로 규정되어 있으므로 (애플 lightning accessory guideline참조) 전류가 턱없이 부족하다. usb3 kit를 산 이유도 이런 전류 부족을 해결하여 외부기기도 사용할수있게 하기 위함도 있었는데, usb기기의 전원도 안켜진다는것은 아마 십중팔구 전류부족일것이다.

역시 외부 ssd도 연결이 불가능했다.

따라서 다른분들에게는 lightning to usb2 kit을 추천한다. 이미 대부분의 기기들이 이것을 기준으로 만들어져있어서 연결성도 좋다. usb3 kit은 전원연결부 때문에 usb-a-male port에 연결할수도 없다. (ifi portable dac 같은 제품들) 

애플 자체 펌웨어 업데이트가 지원된다는것은 좋지만, 실질적인 효용성이 뭔지는 모르겠다.

미안하지만, 태클은 사절이다. 당신 분야에 대해서 당신이 아는것과 다른 단어를 써서 화가 날수도 있겠지만, 나는 아는 것이 많아서 뭉뚱그려서 두리뭉실하게 말하는거니까. 별로 틀린말 하는것도 아니고 당신 전문분야의 용어를 안쓴다고 뭐라고 하지는 말기를

Thursday, 1 September 2022

Personal Timeline

 Personal timeline is the feature that tracks the past and the future of the person's location and providing local time all the time during scheduling.


All right reserved. Albertus Liberius. 

Wednesday, 27 October 2021

Bugs: watchOS 8 does not show notification

 If you set the option to hide the detail of the notification when the watch is screen off in WatchOS7, now watchOS8 will not show you the content of the notification even when you tap the full-screened icon but you can only dismiss the notification without checking its content. This is hell out of sense. This year's update has so many bugs like this. The OS cannot properly load the preference data and make it unusable.

I found the solution:

Settings->Notifications->Show Notifications on Wrist Down->Show Notification 

Turn off and then on the option.

Tuesday, 19 October 2021

USB-C 충전 안되는문제

나무위키를 보다가 이런 문서를 발견했다. 
 4.4. USB Type-C 단자 충전 먹통 문제[편집]

    2020년 이후 USB Type-C 단자가 스마트폰 외 자잘한 기기까지 널리 보급되면서 이유를 알 수 없는 충전 불가 상황이 발생하고 있다. 주로 Type-C 단자를 가진 최신 소형 선풍기(a.k.a. 손풍기), 손난로, 일부 보조배터리 등등에서 발생하는데, C to C 케이블로 충전을 하면 충전이 안되고, A to C 케이블로 충전을 하면 충전이 되는 현상이다. Type-A와 Type-B가 달린 케이블을 썼던 시절엔 충전을 해주는 기기(A)와 충전을 받는 기기(B)를 (방향을 뒤집어도 안 꽂힐 지언정) 잘 못 꽂을 일이 없기 때문에 충전 시스템이 복잡하지 않았다. 그저 고속충전이 가능한지 불가능한지 여부만 문제될 뿐이었다. 하지만 Type-C가 달린 케이블의 경우, 어느 쪽 기기가 충전을 하는 기기인지 단자모양으로는 방향성을 정할 수 없기 때문에, 기기 간 충전 규격이 맞지 않으면 충전이 거부되는 상황이 발생한다. 이에 따라 싼 주변기기 같은 경우 Type-C 케이블을 꽂아도 충전이 되지 않는 상황이 발생한다. 케이블 방향성이 문제되는 것이기 때문에 Type-A to Type-C 케이블을 쓰는 것으로 문제를 해결할 수 있다. 같은 이유로 Type-A 충전기를 쓰면 위 문제를 겪을 일이 없다. USB-PD가 지원이 되지 않아 PD 고속충전이 되지 않더라도 USB Battery Charging나 퀵차지 등 (별도 지원되는) 규격을 통해 고속충전이 이루어 질 수 있다. 케이블에 젠더를 끼워서 문제를 해결할 수도 있다. Type-B 케이블에 Type-C 젠더를 끼우던가, Type-C 케이블에 Type-A 젠더를 끼우는 방법 등이 있다. 만약 젠더를 꽂았는데 동작이 안된다면, PDO 방식, PPS 방식 지원 문제와 엮여있을 수도 있다. 젠더 따위에도 나름 스펙이 존재하는 듯 하다.(젠더 가리는 영상)(젠더에 따른 OTG 가부 사례)[7] 믿을 수 없겠지만, 케이블을 반대로 꽂아야 (뒤집어서 반대가 아니라 돌려서 반대) 정상동작 되었다는 일화도 전해져 내려온다.# 기기간 누가 충전하느냐 싸인을 잘 못 주고받으면 원치 않은 방향으로 충전되는 일도 발생한다. 가령, 노트북으로 보조배터리를 충전할지, 보조배터리로 노트북을 충전할지.# 꺼진 노트북이 주변기기(스마트폰 등) 충전해주는 방향으로 설정되어 있다면, 충전기가 노트북을 충전시키지 못하는 경우도 발생할 여지도 있다. 정품 충전기를 쓰면 왠만하면 이러한 문제는 나타나지 않을 것이다.


여러가지 문제가 뒤섞여 있어서 엉터리 문장이 되어있어 놀랐다. 모두들 나무위키를 바보취급하지만 위키피디아나 유튜브등 오픈형 플랫폼들이 혐오의 장이 되어있는 요즘, 나무위키는 사용자들의 경험을 바탕으로 작성되기 때문에 의외로 별로 문제있는 경우를 잘 보지 못했었다. 이번 경우는 반대로 경험이 독을 불러온 상황같다. 보통 이렇게 내부 구조를 모른채 디버그를 하다보면, 나름 과학적으로 설계한 실험이라고 해도 엉뚱한 결과를 도출하는 경우가 자주있다. 나 또한 이런 케이블 문제나 충전문제 등으로 문제를 자주 겪었고 디버그 결과 부끄럽게도 나중에 생각해보면 잘못된 결과를 이끌어냈던 경우가 많다.

일단, 윗 문장 처음은 누구나 공감할수 있는 문장으로 시작한다. 과거 micro usb-b 충전포트를 가지고 있던 값싼 악세사리들이 모양만 usb-c로 바꾸면서 일반 pd 충전기로 충전이 안되더란 문제이다. 나도 이 제품들을 다 뜯어본건 아니지만, 이 문제에 대한 해답은 간단히 예상할수 있다. 이 회사들은 그냥 모양만 usb-c를 썼을뿐, usb-c규격의 회로는 구성하지않고 그냥 간단히 vcc랑 gnd핀만 따서 연결했을 가능성이 높다. 아무리 usb2.0규격이라고 파워공급을 usb-c로 받으려면 handshake chip, 하다못해 5.1kohm pull-down resistor가 cc 핀에 연결되어있어야 정상적으로 UFP 로 인식이 된다. 아마 저런 악세사리들은 cc pin연결이 안되어있을것이다. 그러니 usb-a 충전기로만 충전이 되는 사태가 벌어진다. 왜냐하면 내부회로가 usb-a처럼만 되어있기 때문이다.

젠더를 끼우니마니 하는 문제도 비슷하다. micro usb도 usb-a와 같은 핀 (ID핀 추가)을 가지고 있으므로 순서에 따라 충전이 되니 안되니 하는것은 당연하다. 특히 삼성의 경우에는 초기와 최근 2,3년 새로 발매한 제품의 충전 규격도 다르기 때문에 주의해서 봐야한다. 호환안되는 사태를 막고자 삼성 나름의규격도 있으나, 기본이 되는 Quickcharge 규격만 봐도 QC3.0과 4.0은 전혀 호환이 안되고 qc4.0과 pd는 호환이 된다. QC3.0은 D+,D-로 handshake를 하고, usbc규격들은 cc pin으로 handshake를 한다. 이런것들만 잘 살펴봐도 쉽게 이해가 될것이다.

그 다음으로 사례들로 언급되는 것들을 보면 일반 상식으로는 이해가 안되는 사례를 나열해놓았다. 이들은 방금 언급한 것과는 다른 문제들이다. USB-c to USB-c 케이블에서 방향성이 있다는 주장인데, 이것이 처음에 내가 말한것처럼 디버그가 잘못된 사례일 가능성이 높다. 왜냐하면 다른 사람에게는 그런 문제가 발생하지 않기 때문이다. 원 저작자도 그래서 굉장히 조심스럽게 '자기는 그냥 그렇게 결론내리고 쓰기로 했지만 뇌피셜이니 함부로 퍼가지말라'는 스탠스를 취하고 있지만 역시 나무위키에서는 그냥 퍼왔다. 내생각에는 원저작자분께서는 수리를 빨리 받으시는게 좋을것 같다. 아마 케이블이나 메인보드의 냉납때문에 연결이 떨어지게 되면서  한방향의 handshake가 제대로 작동하지 않았던 가능성이 높은것 같다.

USB-c는 여러가지 규격이 있지만 간단하게 설명하자면 cc-pin이라는 power handshake를 해주는 버스가 있는데 이 버스에서 제일 간단한 규격은 그냥 저항값이 얼마이고 pullup되어있는지 pull-down되어있는지에 따라, 즉 vcc에 연결되어있는지 ground에 연결되어있는 지에 따라 그 역할이 정해지게 되어있다. 케이블에서도 한때 문제가 되어, 요즘에는 5.1k pull-down이 되어있다고 선전하는 usb-c to usb-a 케이블들이 있는데 이런 이유때문이다. 케이블측에서는 과전류 공급으로 타버리는등 사고가 있어서 cc pin규격만큼은 돌아보게만드는 계기가 되었지만, 악세사리 제조 영세업세들에서는 이런 사고가 없으니 그냥 USB규격을 안지키고 물건을 만들게 되는것 같다.

Sunday, 12 September 2021

삼성 스마트 키보드 트리오 새로운 문제점

갑자기 장치 인식이 끊겼다가 재연결되면서 키 매핑이 완전히 바뀌는 문제를 발견. 컨트롤은 계속 눌린 상태이고 ESC는 시작버튼에 매핑이 되고... 완전 엉망진창. 한번 껐다 켜는걸로는 안되고 몇번 껐다켜니 해결은 됐는데... USB 끊기는 소리나서 식겁했다.

Saturday, 3 July 2021

One old Apple's bug and its remedy.

*The problem I am going to explain now has been always there as far as I know. Thus, I don't know whether this problem appeared some day, or has been there since its beginning, or has been fixed very recently while I haven't noticed. However, I highly suspect that the problem is still there from the beginning to now, and no one seems to be interested in addressing or fixing this issue while it is very annoying problem in practical use.


In Apple's API, Gyro data is represented in CMAttitude 3D Euler angle object, and this has 2 different representations, rotation matrix and quaternion. Mathematics proves that there shall be 2 singularities, north and south pole. Due to Apple's weird coordinate definition (Getting Raw Gyroscope Events | Apple Developer Documentation), those singularities happens at very annoying position: as far as I remember, it is upright position. Anyway, I remember that the position was in very frequent daily use area.


Now, when you want to measure relative rotation, you may use 

or

but any of these move singularities. I think this seems that Apple internally performs operation between two CMAttitude object by converting into quaternions and multiplying them. As the conversion to quaternion is not a one-to-one function, quaternion operations seems not to move singularities.


If you replace CMAttitude.multiply(byInverseOf: CMAttitude) to explicit CMMatrix multiplication, you can confirm that the singularities move to the farthest points from the reference attitude.

Friday, 26 March 2021

Baseus Charger may damage your iPad

Seems some ESD? cause iPad malfunction during charging by Baseus 65W 2C1A charger. I am scary that this may someday damage my iPad. I continued to use it because another Baseus charger is USB-IF certified (no dual charger is certified. Maybe dual charging chip is outside of the standard in any way.) But now my Apple Pencil started to glitch all over the screen to I may have to stop to use.

Monday, 22 March 2021

CMAttitude singularity

 By experiment, you can figure out q = (cos(yaw/2) + k sin(yaw/2)) * (cos(pitch/2) + i sin(pitch/2)) * (cos(roll/2) + j sin(roll/2)) where yaw and roll are in \([-\pi, \pi]\) and pitch is in \([-\pi/2, \pi/2]\). 

Since quaternion <-> rotation matrix is not one-to-one, we have to play with original expression, matrix. As apple's rotation matrix is active rotation, (current rotation matrix) = (relative matrix) * (reference frame rotation matrix). This gives proper singular points, 90deg and -90deg pitch from the reference attitude. If you just use quaternion i.e. CMAttitude system API, singularities are at the fixed point, absolute 90, -90deg pitch point. 90deg pitch point is right at the attitude when you are holding phone right up, which is pretty annoying.

little tips to close overlay on SwiftUI

 This is about the architecture of SwiftUI.

Objective: I want to open and close little overlay message box.

When closed, I don't want to use system resource, and additionally I'll be happy if I can use onAppear and onDisappear.

Also, I want my closing animation work properly.

Implementation:

1. Use complete object destruction by defining 

func View.overlay(_ view: View?) -> View {
    if view == nil{
        self
    }else{
        self.overlay(view)
    }
}

In this way, when I started closing animation by withAnimation{overlayView = nil}, the screen shows preview of the main view, so I see all the blinks and glitches.

2. opacity -> 0

By this method, I am worried that I cannot achieve the objective. It is wasting my resources and I think I cannot use onDisappear.

3. hidden(_ bool: Bool)

Define this function for View. This worked perfectly so I did not tested 2nd option. I think this is supposed to do, designed by Apple developers.

In this way, onAppear is called *when the mainview.overlay() is called * when overlay is unhidden *but not when overlay is not completely hidden but new appearance is called. onDisappear is called *when overlay is completely hidden (end of animation) *but not when overlay hiding animation is over but new overlay unhiding is called.

Wednesday, 10 March 2021

iOS 14.4.1 critical bug

 Local paths are inaccessible in Files app. When you try to access it, app freezes.

Sunday, 7 March 2021

Calculation of crosstalk in common ground cable (e.g. 3.5mm)

 Cross talk is roughly the voltage difference made by the resistance of common ground cable.

For example, let's assume AWG 24 1m cable. Single thread of it has R_(CG)=83.4mOhm.

Also let's assume 75dBA listening sound in 105dB/mW, R=47Ohm headphone.

Then, V = 6.856mV = -43dBV = -41dBu 

I = 145.9uA.

The crosstalk = I*R_(CG)/V = R_(CG)/R. (in voltage ratio i.e. dB = 20 log(V/V))

If we aim for -85dB crosstalk in 47ohm headphone, 3.5mm cable must have less than 2.6mOhm.

This is from TI's crosstalk guideline.

83.4mOhm is 32x of 2.6mOhm so -85dB+30dB = -55dB crosstalk in 47ohm headphone with AWG24 1m cable.


One more example. Take best case Silver AWG18 0.5m cable. Cable resistance is 10mOhm. Take 600Ohm headphone. Then the crosstalk is 20log(0.01/600) = -96dB.

Difference between copper and silver is 0.5dB. Best thing to do is to make sure cable thick.

Monday, 25 January 2021

VR 기기 비교 2021년 1월

판매중기기 가격 시야각(8.43sr) 해상도(7370pixel/rad) 주사율 DOF 배터리시간 IPD 트래커 외부설치
Oculus Quest 2 41만원 21% 16% 90Hz 6DOF 2시간 56~70 X
VIVE Cosmos Elite 143만원 28% 11% 90Hz 6DOF 2시간 61~73 O
VIVE Cosmos 115만원 28% 11% 90Hz 6DOF 2시간 61~73 X
Pimax 8K 159만원 68% 10% 90Hz 6DOF 55~75 O
삼성 HMD 오딧세이+ 52만원 28% 11% 90Hz 6DOF 60~72 X

Friday, 13 November 2020

Display Maximum resolution propose

 human eye can see approx. 120 deg

https://en.wikipedia.org/wiki/Vision_span

and can move 120deg. so, human eye with fixed face can see 240deg.

also minimum pixel for human eye is approx 28sec.

https://webvision.med.utah.edu/book/part-viii-psychophysics-of-vision/visual-acuity/

Thus, for full experience for VR, we need approx 240deg * 60min/deg * ((60sec/min)/30sec) = 14400pixel.

Let's call "FullRetina resolution = (14K)^2".

Friday, 18 September 2020

Most disturbing changes in Xcode 12

 As versions go up, more bugs appear. Also, from Xcode 12, complete integration of macOS UI into UIKit started. When you are trying to debug on Xcode 12, you'll get to the most disturbing moment; no debug area in the Xcode. No bottom panel showing button. What you have to do is go to Menu > View > Debug Area > Show Debug Area ( Cmd + Shift + Y ). I don't know why they removed bottom panel button while right panel button is still there. Because there is no top-bottom split window scheme in iOS? C'mon, you can do better than that!

Also, there is a bug that randomly run button is disabled. You can still build/run by shortcuts. Only way to fix this is to completely restart Xcode.

Saturday, 1 August 2020

홈택스

정부기관을 이용하는데에 아직도 PC가 필수이고, 게다가 Locale Emulator까지 써야하는게 믿기지 않는다. 더이상 non-Unicode 옵션은 없는데도, 정부사이트는 가장 최신것마저 10년전 그대로이다. 정말 변해야만 했던 시절 딱 필요한것만큼 변한 모습이다.

Monday, 26 December 2016

애플 워치로 스이카

간단하게 써보겠습니다. 1. 애플워치로 모바일 스이카를 써보자. 2. 일본에서 워치를 싸게 사자. 이런 두가지 목표를 가지고 있었습니다.
드디어 워치를 샀는데요. 제가 사기 전에 아무리 검색해봐도 제가 궁금한 점에 대한 대답이 없었는데 그것에 대해 직접 겪은 걸 적어보겠습니다.

1. 애플 워치 이세탄??
애플 홈페이지에서 애플 스토어를 검색하면 일본에서만 이상하게 '애플 워치'라는게 검색됩니다. 이거 애플 스토어 아닙니다. 애플 직원이 운영하는건지는 모르겠는데, 어쨌든 준비되어 있는것도 부족하고 이세탄 백화점에 입점해있는거라 이세탄 정책을 따릅니다. 환불, 교환 안되고요, 면세도 다 안됩니다. 이세탄 백화점 정책에 따라 세금포함 결제 후 면세 카운터로 가는데요, 거기서 수수료 1%를 뗍니다. 결국 7% 밖에 못 받는거죠.

2. 보증기간
애플홈페이지에 명시되어 있는거처럼 로컬보증입니다. 예전 리뷰들을 보면 한국 서비스센터에서 그냥 서비스 해줬다는 글이 많이 보이는데 지금은 잘 모르겠습니다.
직원의 말에 의하면 애플케어는 구입 즉시, 혹은 30일 이내에 구입해야하고, 케어 구입하면 글로벌 보증이 된답니다. 이건 참 특이하죠.

3. 한국 워치로 스이카??
이건 아직 제가 못 푼 의문인데요, 애플홈페이지에서 전파모델 보는 페이지로 가도 일본모델이 따로 없기 때문에 글로벌 모델로 추정됩니다. 그렇지 않으면 보증을 산다고 글로벌 보증으로 변할까요. 정확한것은 누가 확인해주시면 좋겠습니다.

--여기서부터 예전부터 가지고 있던 의문에 대한 대답인데요--
4. 애플 계정 국가 설정
스이카를 쓰기 위해 일본 계정이 필요없습니다!! 한국 계정도 됩니다. 이걸 확인한건 정말 기뻤습니다. 
되는지 확인하실려면 그냥 스이카 앱 까시고 실행해보면 되는지 안되는지 떠요. (일본 아이폰7이 아니시면)
5. 스이카 충전을 위한 신용카드
스이카를 만들려면 초기에 요금을 충전해야 하는데 여기서 '일본 국내카드가 아니면 안된다'는 게 지금까지 결론이었죠. (혹은 국가코드가 없는 JCB카드로 결제)
무려, 일반 한국비자카드로 결제가 되었습니다!! 몇번씩 토해냈었는데 계속 시도하니까 결국 되더군요. 정말 놀랐습니다. 이걸로 환율 낮을때 미리 충전해놓는다는 선택지도 가능해졌죠..
모바일스이카 서버가 대응하는 카드 범위를 넓힌건지 어떤건지 잘 모르겠네요.
첨에 스이카 만드실때 기명식으로 한다음에 모바일스이카 서버에 비자카드 등록해주시고, 등록카드로 결제를 선택하면 정상적으로 만들어집니다.
이후에는 계속 신용카드로 충전하거나 편의점에서 현금으로 충전할 수 있습니다.

Monday, 3 November 2014

How to use easiest version control system

When you lost your data or history by crash or accidently saving process, you might be very frustrated. People usually use Dropbox, but Dropbox cannot sync into custom directories, multiple history branches, and massive collaborators. I will introduce intuitive guide to one of version control system 'git', which supports multi-branch, multi-collaborator projects.

The only point people might hesitate may be that git is open-source-based: mostly you are forced to share your sources you uploaded on the git repositories. There is good service which avoid this license: bitbucket, which gives up to 5 free private repositories per user. This service is provided by Atlassian who also provides git client program with intuitive user interface: SourceTree.

First, you should make your repository on the server e.g. bitbucket. Then, you should clone your server repository into a blank directory of your local disk. When you change your local file, the sourcetree app shows what is changed, and you can 'commit' to make a node to the history line. 'push' pushes the nodes to the server and make changes to the server which are shared to all collaborators. If there are conflicts between collaborators, it automatically merges, or you can fix it in your way. When you transfer into another branch, data of the local repository changes, so you should be aware of it.