Question
Modify Example 2.17 so that the maximum correlation is found between the EEG signal and a number of sinusoids ranging in frequency between 1 and
Modify Example 2.17 so that the maximum correlation
is found between the EEG signal and a number of sinusoids
ranging in frequency between 1 and 25-Hz. Increase the
sinusoid frequencies in 0.5-Hz increments using an
additional loopyou will need to repeat the inner loop 50
times for 50 different frequencies. Also limit the phase shift
to between 0 and 179 deg, and find the maximum positive
or negative correlation. Plot only one graph: the maximum
correlation as a function of the sinusoidal frequency.
BELOW IS THE EXAMPLE. ANSWER MUST BE MATLAB CODE
%Example 2.17Comparison of sinusoids at different frequencies with the EEG signal % using crosscorrelation. % load eeg_data; % Get EEG data fs=50; % Sampling frequency t=(1:length(eeg))/fs; % Time vector % for i=1:25 f(i)=i; % Frequency range: 125 Hz x=sin(2*pi*f(i)*t); % Generate sine rxy=axcor(eeg,x); % Perform crosscorrelation rmax(i)=max(rxy); % Store max value end plot(f,rmax,'k'); % Plot max values as function of freq. .labels .
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started