C++ :: Doing Fourier Transform - Different Frequencies
Jul 5, 2013
I am having problems doing the fourier transform:
[URL] .....
My code is:
esc = 2;
maxi = 0;
fu = 500;
fo = 3000;
for (f=fu;f<=fo;f + esc) {
[Code] ....
Don't worry about the exp and complex numbers because they work correctly. N is the number of samples of the input (2500). Esc is the difference between different frequences. So the samples of the output are (1250).
I'm trying to create a program that will play scales at certain frequencies, but my arrays are not initializing correctly. I've read up to double check what i'm doing but it doesn't seem to be working. My only guess is my use of a global variable.
const int NotesInScale = 8; class Scales { private: //all Major Scales int CMajor[NotesInScale]; int GMajor[NotesInScale];
[Code] ....
i'm simply trying to put the frequencies in the scales (the numbers in the array) but I keep getting an error. I feel its a simple fix but i'm not seeing it.
I am trying to transform seconds into HH:MM:SS. I thought it would be easy using the TimeSpan functions however my hours exceed 24 hours now and then therefor it is not viable for use.
private string getFormattedTimeFromSecond(double second) { TimeSpan t = TimeSpan.FromSeconds( second ); string answer = string.Format("{0:D2}h:{1:D2}m:{2:D2}s", t.Hours, t.Minutes, t.Seconds); }
This is what I have tried, however it does not like it much when hours exceed 24.
Above is the code I have tried using and it stores data under *chr, it however only stores one letter rather than the entire word like for example string.
I have a problem concerning transforming int array into bmp image. I wanted to add a post in this topic: [URL] .... , but unfortunately it is closed. Actually I have a question concerning the code written by Duoas. I have a function which takes values from the file and I want to convert it into bmp with the use of Duoas code. I do it like that(it's Duoas code + my load and main function) Is it something wrong with how I do it or it's rather sth wrong with the file.
It compiles without errors but when I run it: core dumped.
According to gdb debugger problem is here: double hue = (intarray[ row - 1 ][ col ] - min_value) * granularity; programs stops, segmentation fault ...
i am looking for a verified code in simple c, for generating fft of an input image (.jpg). the output can be a text file including fft coefficients.can you recommend me any source except open-cv?
I was wondering if its possible to change the color of the anchor point in the transform tool.
Is this possible? Sometimes I'll move it and it takes forever to find it again on a dark image. The actual image of the cross hairs must live in the application contents somewhere? Or its made by script. After a quick search of "transform" I found this file.. Not exactly sure what I'm looking at inside but it appears to be c++ code? [URL] ....
I have this code which performs the analysis part of discrete wavelet transform. It works pretty well. However, I wish to reduce the time that it consumes even further. I did use reserve() and it worked upto few msec.
int rows = signal.size(); int cols = signal[0].size(); int cols_lp1 =(int) ceil( (double) cols / 2); vector<vector<double> > lp_dn1(rows, vector<double>(cols_lp1)); vector<double> temp_row; temp_row.reserve(512);
I predicted the outcome as being 01230 as I thought the prefix decrement operator on iterator ce would prevent the final element of the list from being transformed.
I was wrong, the correct output is 01234.
So, I removed the decrement prefix and ran the test again, expecting a different result. It wasn't! The result was still 01234.
Only when I decremented ce twice did I get the result I initially expected, 01230.
why the first decrement of ce appears to have no effect?
I need to transform a local variable into a global variable so I can use it in one of my functions. I thought about passing the value as a parameter to this function but I can do this since the function is called inside the while loop and this variable counts how many times the while loop does (so the final value is outside the loop). Example to visualize better:
I have my program to load info about students from .txt file
Mrkvicka Jozef 2 1.75 2.1 0.4 1 0.49 1.27 Hrasko Jan 0.1 0.38 1 1.2 Mladek Peter 1.6 0.4 2 1.3 1.8 Petrzlen Robert 0.6 0 1.1 1.1 0.6 0.59 Horvath Ivan 1.6 0.8 0.7 1.3 1
My program is ruuning perfectly only problem is that i must transform it to program uses class, class student . Am very beginer in using classes, so far i do very easy programs using classes.