Tuesday, July 15, 2014

Week Six - Day One

The poster is mainly completed except one part which was the addition of the graphs that showed the frequencies after the Fast Fourier Transform. The Python program was finished being adjusted to produce graphs that would display nicely. Before the graphs had axis's that would clump together and the graphs would all overlap each other. This was fixed by creating labels for the x-axis and y-axis to show the intervals. By coding the minimum value and maximum value, the intervals could be extracted by taking the difference between the two and finding every fourth one in that interval. This way all the numbers would be spaced out evenly and could easily adjust itself, which it wouldn't be able to do if it was hard coded instead. 

By coding x = per[0][100:], a 2D matrix is created which says that the first row is the x-axis and their data points and then only the digits from 100 and beyond are plotted. This was done because when first graphing the points extracted from the Emotiv EPOC. there was possibly white noise and that created a spike that didn't have too much importance. This was called High-Pass Filter in which you filter out the high frequencies that distract from the low frequencies. Also, the frequency was changed to 128 which meant that the Emotiv EPOC recorded 128 brain signals in a second. That allowed the frequency (x-axis) to be changed from an interval of 0.5 to an interval of 70. That shows the full frequency and therefore we could see a small peak at 60 Hz. The small peak could be seen at both the FC5 and F8 which are near the frontal lobe and 60 Hz shows delta waves that mean concentration or focus which would make sense for the action of reading. Another difference found would be that the high peaks are found at the low frequencies for reading and found in the middle frequencies between 30 Hz and 40 Hz for watching cartoons. The band width frequencies show which waves (alpha, delta, theta, etc.) are active and that can be used to determine the action being done. 




*Signal Processing with Neuroscience

Thursday, July 10, 2014

Week Five - Day Two



Talked about the poster and at first, our poster was blocked off with text and very structured with 3 by 3 square cubes. The people working with us explained how sometimes it's okay to make research posters consisting mainly of text but when you understand the project, it's better to have pictures and illustrations. A illustration can explain an idea in many ways that a block of text can't, but if the audience or the presenter does not fully understand the project, having text for the audience to read through can be useful.

The figure above was an illustration I drew in paint to describe my idea for the poster. I choose to make the poster itself an illustration of the process and apparently this type of poster is very useful for seminars. The reason this type of poster may be useful is because even with illustrations and graphs, the overall poster passes on the message and flows, making the path the eye follows flow around the poster. This allows every point to be covered. The name of project would be stationed in the middle and the intro in the top left corner. Then the information text would be fed into the brain and the Fast Fourier Transform would spit out the different frequencies which would contain different sentence lengths describing what my part of the project consisted of. Then the output from the Fast Fourier Transform would then be inputted into the Cortical Learning Algorithm and the text would trickle down and form at the bottom. Although the Cortical Learning Algorithm goes from the bottom and heads up, the flow of the poster leads down. After being classified by the Cortical Learning Algorithm, the output from that get's inputted into the game as the controls instead of the EmoKey. The instructions screen and game over screen would be replaced with text with a picture of the game on the side. That all leads to the finished product and the name of the over all project which is Game-Mind Interface.

During practicing to present the poster, it's good to have a few tips:
- It's okay to say "That is beyond the extent of our research/knowledge" if someone asks something you don't know
- Keep it simple at first and go into more detail if they start asking questions, give a summary and general idea in the beginning
- Talk about Neurofeedback when discussing future plans about the educational game 
Week Five - Day One

Last week was the end of working on the project fully and now we've moved onto working on the Research Paper and Poster that is required. The research paper and poster are the final key elements for the individual research projects. The whole day consisted of working on writing our research papers and working on the poster.

The Poster consisted of all three of our parts and I wrote a small paragraph on my part to be included in the poster:

'When the user wears the Emotiv EPOC headset and trains in the Expressiv or Cognitiv Suite, those specific actions generate certain brain signals. After the extraction of the brain signals from the headset, a Python program plots the function as a graph for visualization. The differentiation between all the activities requires a decomposition of the overall function. Therefore, the implementation of the Fast Fourier Transform function in Python helps reduce the function into its sine and cosine components to become the output. The Fast Fourier Transform estimates unusual function on an interval, transforming a function of time into a function of frequency. It essentially depicts the mapping between two sets of domains, therefore allowing the time domain to become altered into the frequency domain. The output then becomes passed onto the Hierarchical Temporal Memory as an input.'

For the research paper, the abstract is supposed to be written with a motivation, problem statement, approach, results, and conclusions part. The motivation is supposed to explain why we care about the issue or project. The problem statement is supposed to tell the reader what the issue at hand is and the scope of the work. The approach is how you go about solving the problem or going about working on the project. The results explain to us what the answer is or what came out of the project. The data or analysis or thoughts. The conclusion explains what the future work may be or how the project will impact the world. 
Week Four - Day Two

After collected brain waves from someone who was working along side me with another portion of the project, I am plugging the data into the python code to return and plot the Fast Fourier Transform of that signal. The three signals collected were ones where the subject spent a limited amount of time reading, solving integrals, and watching cartoons.

With the use of various python libraries such as SciPy, NumPy, and Matplotlib, visualization of the Fast Fourier Transform became more accessible. Matplotlib is a 2D plotting library that produces graphical displays of models such as line graphs or representations of data. The reason for the program was to be able to analyze the data inputted, in a simpler and more efficient fashion.

Transforming the .edf files into Ascii files utilize the ggc which is a compiler that changes the C Source Code into a ./a.out code. Which is an assembler output while the other file was a C source code. Typing ggc edf2ascii.c into the terminal allowed the .edf files to be turned into comprehensible .txt (text) tiles.


Thursday, July 3, 2014

Week Four - Day One

Today, I am planning on using Scipy, Numpy, and other python libraries to work with using the Fast Fourier Transform and extracting the spectra from the brain. As the brain thinks, there will be various signals sent out that will come in the form of some type of wave, in which I use the Fast Fourier Transform to take the sine and cosine components and turn it into a periodic function.

I've also learned a bit about matplotlib which a python library that allows one to plot graphs or charts. Using (import matplotlib.pyplot as plt), one can just write plt.plot (x, y, 'bo') and then plt.show( ) and the graph will appear when you run the code. I've realized that 'bo' means that the displayed graph will show blue dots, more specifically, on a scatterplot. 'rs' would display red squares and g^ displays green triangles. Although I've also realized that the code I was using was for scatterplots and to get graphs with a grid, plt.grid(True) had to be used.

The same code I wrote was:

from scipy.fftpack import fft, ifft, fftfreq
import matplotlib.pyplot as plt
import numpy as np

theta = 4*np.pi
t = np.linspace(0, 4, 100)
x = np.sin(theta*t)*np.exp(-5*t)
sp = fft(x)
axis = -1
freq = fftfreq(t.shape[axis])
plt.plot(freq, sp.real, freq, sp.imag)
plt.grid(True)
plt.show()

In which it displays:
















A periodogram is an estimate of distribution of data of a signal. The Boham, parzen, boxcar, and hamming are all different windows that restrict the mathematical function to a certain interval.

When using t = np.linspace(0, 4, 100), the default number of points it plots is 50 and you can change the number of points by chaning the last digit to another number, for example 100. The more points are ploted, the better the data is represented.