/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Problem 45 Numerical differentiation of noi... [FREE SOLUTION] | 91Ó°ÊÓ

91Ó°ÊÓ

Numerical differentiation of noisy signals. The purpose of this exercise is to look into numerical differentiation of time series signals that contain measurement errors. This insight might be helpful when analyzing the noise in real data from a laboratory experiment in Exercises \(8.44\) and \(8.46\). 1\. Compute a signal $$ \bar{\eta}_{i}=A \sin \left(\frac{2 \pi}{T} t_{i}\right), \quad t_{i}=i \frac{T}{40}, i=0, \ldots, 200 $$ Display \(\bar{\eta}_{i}\) versus time \(t_{i}\) in a plot. Choose \(A=1\) and \(T=2 \pi\). Store the \(\bar{\eta}\) values in an array etabar. 2\. Compute a signal with random noise \(E_{i}\), $$ \eta_{i}=\bar{\eta}_{i}+E_{i} $$ \(E_{i}\) is drawn from the normal distribution with mean zero and standard deviation \(\sigma=0.04 A\). Plot this \(\eta_{i}\) signal as circles in the same plot as \(\eta_{i}\). Store the \(E_{i}\) in an array E for later use. 3\. Compute the first derivative of \(\bar{\eta}_{i}\) by the formula $$ \frac{\bar{\eta}_{i+1}-\bar{\eta}_{i-1}}{2 h}, \quad i=1, \ldots, n-1 $$ and store the values in an array detabar. Display the graph. 4\. Compute the first derivative of the error term by the formula, $$ \frac{E_{i+1}-E_{i-1}}{2 h}, \quad i=1, \ldots, n-1 $$ and store the values in an array \(d E .\) Calculate the mean and the standard deviation of \(\mathrm{dE}\). 5\. Plot detabar and detabar \(+\mathrm{dE}\). Use the result of the standard deviation calculations to explain the qualitative features of the graphs. 6\. The second derivative of a time signal \(\eta_{i}\) can be computed by $$ \frac{\eta_{i+1}-2 \eta_{i}+\eta i-1}{h^{2}}, \quad i=1, \ldots, n-1 $$ Use this formula on the etabar data and save the result in d2etabar. Also apply the formula to the E data and save the result in \(\mathrm{d} 2 \mathrm{E}\). Plot d2etabar and d2etabar + d2E. Compute the standard deviation of d2E and compare with the standard deviation of \(\mathrm{dE}\) and \(\mathrm{E} .\) Discuss the plot in light of these standard deviations. Name of program file: sine_noise.py. 0

Short Answer

Expert verified
First and second derivatives of noisy signals show increased variability compared to clean signals due to added noise components.

Step by step solution

01

Compute and Plot the Signal

We begin by calculating the signal \( \bar{\eta}_{i} = \sin \left(\frac{2 \pi}{T} t_{i}\right) \) where \( t_{i} = i \frac{T}{40} \) for \( i = 0, \ldots, 200 \). With \( A = 1 \) and \( T = 2\pi \), we simplify this to \( \bar{\eta}_{i} = \sin(t_{i}) \). Store these values in an array `etabar`, and plot \( \bar{\eta}_{i} \) versus \( t_{i} \).
02

Introduce Noise to the Signal

Create a noisy signal \( \eta_{i} = \bar{\eta}_{i} + E_{i} \) where \( E_{i} \) follows a normal distribution with mean 0 and standard deviation \( \sigma = 0.04 A \). Store \( E_{i} \) values in an array `E` for later use. Plot \( \eta_{i} \) as circles on the same plot as \( \bar{\eta}_{i} \).
03

Compute the First Derivative of the Clean Signal

Use the formula \( \frac{\bar{\eta}_{i+1}-\bar{\eta}_{i-1}}{2h} \) for \( i = 1, \ldots, 199 \) to compute the first derivative of \( \bar{\eta} \). Here, \( h = \frac{T}{40} \). Store these values in `detabar` and plot the result.
04

Compute the First Derivative of the Error

Apply the formula \( \frac{E_{i+1}-E_{i-1}}{2h} \) for \( i = 1, \ldots, 199 \) to compute the first derivative of the error term. Store these in an array `dE`. Calculate the mean and standard deviation of `dE`.
05

Analyze First Derivative Plots

Plot the computed `detabar` and `detabar + dE`. Compare these graphs and use the standard deviation to explain the differences qualitatively. This helps in understanding the impact of noise.
06

Compute the Second Derivative of the Clean Signal

Using the formula \( \frac{\eta_{i+1}-2\eta_{i}+\eta_{i-1}}{h^{2}} \) for \( i = 1, \ldots, 199 \), compute the second derivative for `etabar` and store it in `d2etabar`. Also, apply it to the `E` data to get `d2E`. Plot `d2etabar` and `d2etabar + d2E`. Compute and compare the standard deviation of `d2E` with `dE` and `E` to discuss the influence of noise.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with 91Ó°ÊÓ!

Key Concepts

These are the key concepts you need to understand to accurately answer the question.

Noisy Signals
In many real-world applications, signals collected from measurements are often corrupted by noise. This noise can come from various sources such as electronic interference, environmental factors, or inherent variability in the signal itself. For instance, when measuring a time series of a sinusoidal signal, the true signal \( \bar{\eta}_{i} = A \sin \left(\frac{2 \pi}{T} t_{i}\right) \) might appear distorted due to random fluctuations depicted by an error term \( E_{i} \).

Understanding how noise affects the measured signal \( \eta_{i} = \bar{\eta}_{i} + E_{i} \) is crucial:
  • Noise can mask important features of the data, making it challenging to analyze and interpret.
  • It's essential to identify and quantify this noise to enhance the reliability of signal processing techniques.
  • Noise characterization helps in designing systems that are more robust to such uncertainties and errors.
Addressing noise allows us to retrieve the underlying signal more clearly, which is vital for accurate decision-making.
Error Analysis
Error analysis is the process of evaluating the sensitivity of results to errors in the data or method used. In numerical differentiation, understanding how errors propagate is key to interpreting results.

When computing the derivative of a noisy signal, two main challenges arise:
  • The differentiation amplifies the noise because noise fluctuations become more prominent.
  • The computed difference for the error term \( \frac{E_{i+1}-E_{i-1}}{2h} \) helps us to determine the standard deviation of noise derivatives.
By comparing the standard deviations of the original error \( E_{i} \), its first derivative \( dE \), and second derivative \( d2E \), we get insight into how noise evolves through these operations.

This kind of analysis aids in developing strategies to minimize or compensate for errors, improving the accuracy of numerical calculations.
Time Series
A time series is a sequence of data points collected or recorded at regular time intervals. In this exercise, we deal with a sinusoidal time series. Understanding time series data requires examining patterns over time which can help predict future trends or identify underlying structures.

Working with time series involves:
  • Sampling, or discretizing continuous signals into data points that can be analyzed.
  • Handling aspects like seasonality, trends, and noise to better understand signal dynamics.
  • Evaluating the impact of noise on the predictive power and accuracy of the time series analysis.
An effective analysis of time series provides insights into data behavior, particularly when dealing with large datasets from measurements or simulations taken over time, like in experiments contained in exercises like this.
Signal Processing
Signal processing involves analyzing, manipulating, and interpreting signals to extract valuable information. It's a critical field for working with both natural and artificial signals encompassing various applications such as audio processing, telecommunications, and medical diagnostics.

Key practices in signal processing include:
  • Filtering to reduce noise and enhance important features without distorting the original signal.
  • Differentiating signals numerically to study dynamic changes. In this case, the differentiation of the original and noisy signals is exemplified.
  • Using statistical methods, such as calculating standard deviations, to assess and adjust how signals are interpreted.
Applying these techniques helps in refining and improving the quality of signals. This refinement is crucial in making accurate interpretations and developing technologies that rely on precise signal analysis.

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Find the expected waiting time in traffic lights. A driver must pass 10 traffic lights on a certain route. Each light has a period red-yellow-green-yellow of two minutes, of which the green and yellow lights last for 70 seconds. Suppose the driver arrives at a traffic light at some uniformly distributed random point of time during the period of two minutes. Compute the corresponding waiting time. Repeat this for 10 traffic lights. Run a large number of routes (i.e., repetitions of passing 10 traffic lights) and let the program write out the average waiting time. Does the computed time coincide with what you would expect? Name of program file: waiting_time.py.

Estimate the probability in a dice game. Make a program for estimating the probability of getting at least one 6 when throwing \(n\) dice. Read \(n\) and the number of experiments from the command line. (To verify the program, you can compare the estimated probability with the exact result \(11 / 36\) when \(n=2\).) Name of program file: one6_ndice.py.

Choose random colors. Suppose we have eight different colors. Make a program that chooses one of these colors at random and writes out the color. Hint: Use a list of color names and use the choice function in the random module to pick a list element. Name of program file: choose_color.py.

Decide if a dice game is fair. Somebody suggests the following game. You pay 1 unit of money and are allowed to throw four dice. If the sum of the eyes on the dice is less than 9 , you win 10 units of money, otherwise you lose your investment. Should you play this game? Answer the question by making a program that simulates the game. Name of program file: sum9_4dice.py.

Simulate stock prices. A common mathematical model for the evolution of stock prices can be formulated as a difference equation $$ x_{n}=x_{n-1}+\Delta t \mu x_{n-1}+\sigma x_{n-1} \sqrt{\Delta t} r_{n-1} $$ where \(x_{n}\) is the stock price at time \(t_{n}, \Delta t\) is the time interval between two time levels \(\left(\Delta t=t_{n}-t_{n-1}\right), \mu\) is the growth rate of the stock price, \(\sigma\) is the volatility of the stock price, and \(r_{0}, \ldots, r_{n-1}\) are normally distributed random numbers with mean zero and unit standard deviation. An initial stock price \(x_{0}\) must be prescribed together with the input data \(\mu, \sigma\), and \(\Delta t\). We can make a remark that Equation (8.16) is a Forward Euler discretization of a stochastic differential equation for \(x(t)\) $$ \frac{d x}{d t}=\mu x+\sigma N(t) $$ where \(N(t)\) is a so-called white noise random time series signal. Such equations play a central role in modeling of stock prices. Make \(R\) realizations of \((8.16)\) for \(n=0, \ldots, N\) for \(N=5000\) steps over a time period of \(T=180\) days with a step size \(\Delta t=T / N\). Name of program file: stock_prices.py.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.