Java의 정규표현식에서 \와 $ 사용할 때, 오류 발생할 수 있습니다.

이런 문제점을 보완하기 위해서는 quoteReplacement()를 사용할 수 있습니다.

예제1: test.replaceAll(Matcher.quoteReplacement("\\"), "/");

예제2: test.replaceAll("/", Matcher.quoteReplacement("\\"));


  • quoteReplacement

    public static String quoteReplacement(String s)
    Returns a literal replacement String for the specified String. This method produces a String that will work as a literal replacement s in the appendReplacement method of the Matcher class. The String produced will match the sequence of characters in s treated as a literal sequence. Slashes ('\') and dollar signs ('$') will be given no special meaning.
    Parameters:
    s - The string to be literalized
    Returns:
    A literal string replacement
    Since:
    1.5


출처 : http://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html#quoteReplacement(java.lang.String)

반응형

In mathematics, the root mean square (abbreviated RMS or rms), also known as the quadratic mean, is a statistical measure of the magnitude of a varying quantity. It is especially useful when variates are positive and negative, e.g., sinusoids. In the field of electrical engineering, the effective (RMS) value of a periodic current is equal to the DC voltage that delivers the same average power to a resistor as the periodic current.[1]

It can be calculated for a series of discrete values or for a continuously varying function. Its name comes from its definition as the square root of the meanof the squares of the values. It is a special case of the generalized mean with the exponent p = 2.


Definition[edit]

The RMS value of a set of values (or a continuous-time waveform) is the square root of the arithmetic mean (average) of the squares of the original values (or the square of the function that defines the continuous waveform).

In the case of a set of n values \{x_1,x_2,\dots,x_n\}, the RMS


x_{\mathrm{rms}} =
\sqrt{ \frac{1}{n} \left( x_1^2 + x_2^2 + \cdots + x_n^2 \right) }.

The corresponding formula for a continuous function (or waveform) f(t) defined over the interval T_1 \le t \le T_2 is


f_{\mathrm{rms}} = \sqrt {{1 \over {T_2-T_1}} {\int_{T_1}^{T_2} {[f(t)]}^2\, dt}},

and the RMS for a function over all time is


f_\mathrm{rms} = \lim_{T\rightarrow \infty} \sqrt {{1 \over {T}} {\int_{0}^{T} {[f(t)]}^2\, dt}}.

The RMS over all time of a periodic function is equal to the RMS of one period of the function. The RMS value of a continuous function or signal can be approximated by taking the RMS of a series of equally spaced samples. Additionally, the RMS value of various waveforms can also be determined withoutcalculus, as shown by Cartwright.[2]

In the case of the RMS statistic of a random process, the expected value is used instead of the mean.

(출처: http://en.wikipedia.org/wiki/Root_mean_square)

반응형

Equal-loudness contour (등청감 곡선)


등청감 곡선은 우리가 느끼는 소리의 크기를 나타낸 phon 곡선으로서 기준 톤은 1Khz입니다. 이 그래프는 18~30세의 정상 청각 보유자에 대해 적용할 수 있는 규격입니다.


(출처: http://en.wikipedia.org/wiki/Equal-loudness_contour)

An equal-loudness contour is a measure of sound pressure (dB SPL), over the frequency spectrum, for which a listener perceives a constantloudness when presented with pure steady tones. The unit of measurement for loudness levels is the phon, and is arrived at by reference to equal-loudness contours. By definition, two sine waves of differing frequencies are said to have equal-loudness level measured in phons if they are perceived as equally loud by the average young person without significant hearing impairment.

Equal-loudness contours from ISO 226:2003 shown with original ISO standard.

반응형

'오디오 음성' 카테고리의 다른 글

롬바드 효과 (Lombard Effect)  (0) 2015.06.18
Root mean square (RMS)  (0) 2014.06.18
Absolute threshold of hearing (최소 가청값, 최소 가청치)  (0) 2014.06.18
Sound Pressure Level (SPL)  (0) 2014.06.18
dB (Decibel, 데시벨)  (0) 2014.06.18

+ Recent posts