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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!