Introduction

Roasted coffee has an aroma characterized by more than 1000 volatile organic compounds (VOCs) [1, 2]. However, it has been also demonstrated that only a small fraction of these volatiles can be perceived by the human olfactory system [2]. Such chemical species include: (1) pyrazines and furans, (2) aldehydes and ketones, (3) phenols, (4) sulfur compounds, (5) monoterpenes and (6) acids [3,4,5]. Each odorant class contributes to the final coffee aroma with an extent that is greatly dependent on the variety of green coffee, but also on the conditions set during the manufacturing process.

Because of the growing competition in the market of coffee powders and capsules, industries must tune precisely their manufacturing process to achieve specific sensorial attributes and satisfy the consumer demand. Thus, there is an increasing interest to apply analytical devices to measure the presence of volatiles responsible for the coffee aroma and mathematical models able to correlate their content with the manufacturing conditions used [3, 4].

At this purpose, several attempts have been addressed recently to develop powerful gas analyzers enabling the detection of the volatile organic compounds of coffee aroma. One of the most advanced techniques for volatile analysis is proton transfer reaction mass spectrometry (PTR-MS). This device measures the headspace above the analyzed sample directly without any sample preparation. Several studies have demonstrated the advantages offered by PTR-MS to analyze coffee samples, in particular low fragmentation, high time resolution, and broad linear detection range [5].

However, very little is known about the potential use of PTR-MS to develop methods to predict the coffee powder aroma as a function of the manufacturing process. Few authors applied PTR-MS to investigate the effect of roasting on the release of VOCs from coffee beans. Yeretzian et al. monitored the VOCs formation in green coffee beans and during coffee roasting [6]. Gloess et al. applied PTR-MS in the analysis of flavor formation in coffee from different origins during light, medium and dark roasting [7]. Mateus et al. developed a mathematical model of the release kinetics of roasted coffee powder [8]. Indeed, the manufacturing process, together with the green coffee variety, is mainly responsible for the resulting aroma of roasted coffee powder. First, green coffee quality, with its specific composition on precursors, reflects the altitude of the orchard where coffee beans are grown [1]. Altitude together with latitude and slope exposure is responsible for the so-called “Terrain effect”. These geographical factors contribute to the development of volatile and non-volatile compounds responsible for the coffee aroma [9]. In example, previous studies on coffee beans grown at high altitudes have shown that the harsh climate conditions affect the transpiration and photosynthesis activity of the plant, which, ultimately, lead to a more delicate coffee aroma, with increased fruity, acidic and floral notes [9, 10]. A second important factor in the development of the aroma of coffee powder is the fermentation period. After the harvest, coffee beans are fermented by wet or dry processing [11,12,13]. In wet processing, different strains of bacteria and/or yeast are inoculated in the coffee beans. These microorganisms produce metabolic compounds, which can affect the final aroma of coffee [14]. It has been demonstrated that the fermentation time corresponds to a decrement of free low molecular weight sugars, free amino acids and an increase of phenolic compounds [11], likely induced by the activity of isocitrate lyase [15]. Overall, the total amount of VOCs is decreasing at longer fermentation times. Another important factor that influences coffee flavor is the type of roasting. Roasting greatly affects flavor intensity by reducing sugars and amino acids into furans, pyridines, pyrazines and pyrroles [2, 11, 16,17,18]. Depending on the extent of roasting, coffee is commercially categorized as light, medium or dark. The roasting process generates VOCs as products of Maillard, Strecker, hydrolysis and pyrolysis reactions [1, 3]. Although light roasting can emphasize some positive potential of filter and espresso coffee, in some cases it leads to a non-uniform bean color with a sour, grassy, and underdeveloped flavor. Lighter roasting may prevent full aroma development and result in lower VOCs concentration, which makes some sensory attributes (sweetness and acidity in particular) more prominent [19]. The medium roasting process leads to a more balanced taste and aroma, often with notes of citrus flavor. Finally, a dark roast process is likely to produce coffee where the contribution of highly volatile compound, i.e., acids and furans, to the overall aroma is minor. On the contrary, the contribution of less volatile compounds, for example, pyrazine and pyridine become more important [1, 20].

To put in the hands of coffee industry a predictive tool for the identification of those processing variables that influence the resulting coffee powder aroma, it is essential to have an analytical device that can measure the headspace concentration of the characteristic volatile compounds of coffee powder aroma, online and with high reproducibility. For this purpose, this work aims to apply PTR-MS-type gas analyzer to develop a predictive model that correlates the volatile intensity of coffee powder (i.e., strong vs. delicate aroma) with the main processing conditions, including the altitude of the orchard, the fermentation time and the roasting level. In this work, we demonstrate that it is possible to use PTR-MS to develop a predictive tool to design coffee characteristics from specific processing conditions.

Materials and methods

Sample preparation

Coffee beans (Coffea arabica, variety Catimor) were harvested at 900 and 1500 m above sea level in the Doi Chang area, Chiang Rai Province, Thailand by WaweeCoffee Co., Ltd. The coffee cherries were harvested in the same period at both altitudes. The ripe cherries from different altitudes were selectively picked by coffee pickers who have experience in coffee harvesting for more than 20 years. The ripening stage of the hand-picked cherries was assessed by visual evaluation of the cherry skin color. 1 kg of mucilaginous parchment beans, harvested at each altitude, was placed in 10 × 10 cm boxes. 5 L fresh distilled water was added to fill the boxes completely. The beans were fermented in a growth chamber at 28 °C, in dark, for 24, 48 and 72 h. 300 g of green coffee beans harvested at 900 and 1500 m were not fermented. After each time of fermentation, the resulting parchment coffee was dried in a laboratory drying oven at temperatures of 35–40 °C until the desired water content of 12% (wet basis) was achieved. Fermented and not fermented coffee beans (100 g) were roasted at 200 °C by Wawee Coffee Co., Ltd using a PRE1Z small-scale roaster (Probat Inc., Vernon Hills, USA.) Three different roasting profiles were achieved: light, medium and dark. Light-roasted coffee beans were roasted for 6 min, show 1–5% of weight loss and a light brown color; medium-roasted coffee beans were treated for 8 min, show 5–8% of weight loss and a medium brown color; dark-roasted coffee beans were roasted for 10 min, show 8–10% of weight loss and a dark brown color (Fig. 1).

Fig. 1
figure 1

Schematic drawing of the experimental setup

Three different factors were analyzed: harvesting altitude (900 and 1500 m), fermentation time (0, 24, 48 and 72 h) and roasting degree (light, medium and dark), leading to the production of 24 different types of coffee beans. Samples were code named according to all three features (Table 1). 50 g of coffee beans of each type were then milled for 1 min at the frequency of 30 s−1 by Retsch MM 400 Mixer Mill (Retsch GmbH, Haan, Germany).

Table 1 Description of the 24 types of coffee used in this study 170 × 75 mm (150 × 150 DPI)

Proton transfer reaction mass spectrometry (PTR-MS)

The headspace of coffee powder was measured by PTR-QMS 500 (Ionicon Analytik GmbH, Innsbruck, Austria). 35 mg of coffee powder was equilibrated in 40 mL glass vials at 30 °C for 15 min under ambient air. Five replicates for each sample were analyzed. Four more similar replicates were averaged to perform statistical analysis. Four empty vials were analyzed and considered as blanks. The measurement order was randomized to avoid any possible memory effect. The instrumental conditions were the following: drift voltage 600 V, drift temperature 75 °C, inlet temperature 75 °C and drift pressure 2.10 mbar, affording an E/N value of 149 Townsend (1 Td = 10−17cm2 V−1 s−1). The signal intensities were corrected and normalized as previously described [21], with the following equation:

$${\text{ncps}}\;({\text{RH}}^{ + } ) = \frac{{{\text{cps}} ({\text{RH}}^{ + } ) \cdot 10^{7} \cdot {\text{trasmission}}\;{\text{rate}}}}{{500 \cdot {\text{cps}} ({\text{H}}_{3}^{18} {\text{O}}^{ + } ) + {\text{cps}} ({\text{H}}_{2} {\text{O}} \cdot {\text{H}}_{3} {\text{O}}^{ + } )}},$$
(1)

where ncps(RH+) is the normalized count rate for each ion intensity, cps(RH+) is the count per second of each ionized molecule, cps \(({\text{H}}_{3}^{18} {\text{O}}^{ + } )\) is related to the primary ion (m/z 21) and cps \(({\text{H}}_{2} {\text{O}} \cdot {\text{H}}_{3} {\text{O}}^{ + } )\) to water cluster (m/z 37).

The total VOCs was calculated by summing the intensity of each of the 181 ion fragments, except m/z 21 and 37, measured by the PTR-QMS.

Some ion fragments were tentatively identified accordingly to previous works on PTR-MS on coffee [2, 5, 22,23,24,25].

Statistical analysis

All analyses were conducted using R-3.5.2 version from 20.12.2018 (R Development Core Team, 2010) (R Core Team 2013). The linear regression model was built with the caret package [Max Kuhn (2018). caret: Classification and Regression Training. R package version 6.0-81. https://CRAN.R-project.org/package=caret]. Briefly, the data set was randomly split into a training set (80% of the samples) and test set (20% of the samples and their replicates). Samples of the training set were used for the development of the model. The model was then externally validated using the test set.

Results

PTR-MS spectrum

Figure 2a shows a typical PTR-MS spectrum of a coffee sample by highlighting some of the most abundant ions, such as m/z 59, 61, 75 and 80. A similar signal pattern was reported in other works [22,23,24,25]. Figure 2b shows that the signal intensity of m/z 97 (tentatively identified as furfural) increases as a function of the amount of coffee samples loaded in the glass ampoule (fixed volume of 40 mL). Such increment is linear in the range from 5 to 35 mg. For sample loadings higher than 35 mg, the signal seems saturated, reaching a plateau level. At the highest amount of the sample (50 mg of coffee powder), a depletion of the primary ion (m/z 21, \(({\text{H}}_{3}^{18} {\text{O}}^{ + } )\)) was observed. This confirmed the saturation of the drift chamber. Thus, the optimal amount for the detection of VOCs in coffee powder samples was selected as 35 mg. Figure 2c shows also the transient signal of the specific fragment ion m/z 97. This fragment was tentatively identified to be furfural, a compound of great interest for coffee samples. The signal recorded for such a mass fragment is linearly dependent (R2 = 0.97) on the amount of coffee sample. Sensitivity, determined as the slope of the calibration curve, is 1003 normalized cps and LOD below 60 normalized cps.

Fig. 2
figure 2

a Typical PTR-MS signal. b Signal intensity (n = 4) of m/z 97 vs. increasing amounts of coffee powder. c Transient signal of m/z 97 in relationship to different amounts of coffee powder (on the left). In the middle, the signal of the four replicates of increasing concentrations of coffee powder is shown and on the right, six replicates of signal intensity measured for 35 mg of coffee powder

ANOVA on the total VOCs

Table 2 reports the mean values of total VOCs (expressed as normalized cps × 106) as a function of (1) the altitude of the coffee plant, (2) wet fermentation time and, (3) degrees of roasting. The minimum VOC intensity (2.61 × 106 ncps) was observed in coffee powders grown at high altitudes (1500 m), exposed to longer fermentation time (72 h) and to light roasting processes (6 min). Conversely, the highest VOC intensity was recorded for samples grown at low altitudes (900 m), exposed to shorter fermentation times (24 h) and longer roasting processes (10 min).

Table 2 Mean (n = 4) ± standard deviation of total VOCs (× 106 ncps) and the results of the three-way analysis of variance

Table 2 also shows the result of the three-way analysis of variance. The main factors are all statistically significant (p < 0.001). Altitude explained 53% of the total variance, followed by roasting (37%) and fermentation time (10%). The results also highlight a significant interaction between altitude and roasting. This confirms that the altitude plays an important role in developing specific precursors in green coffee, which sets the stage for later flavor development during roasting. 100 g of beans harvested at low 900 m weighed 16.54 g ± 0.17 g, while 100 g of high-altitude beans weighed 17.35 g ± 0.19 g. The different size of the beans harvested at the two altitudes may explain the interaction of altitude and roasting.

Effect of altitude

Figure 3 compares the most intense mass fragments observed among the non-fermented and lightly roasted samples (L900 vs. L1500) harvested at two different altitudes. The ions that showed a significant difference between the coffee samples harvested at 900 m and 1500 m were the mass ions 45 (tentatively identified as acetaldehyde) and 59 (tentatively identified as acetone). Other relevant ions include (tentatively identified as): 69 (furan), 82 (methypyrrole), 99 (2-furanmethanol), 109 (dimethylpyrazine), 111 (acetylfuran), 113 (5-methylfurfuryl alcohol) and 123 (2-ethyl-5-methylpyrazine). Overall, the sum of these VOCs accounts for 75% of the total intensity.

Fig. 3
figure 3

Volatile profile of non-fermented samples harvested at 900 and 1500 m and exposed to light roasting

These results support the hypothesis that high elevation can affect the final quality of the coffee beverage [15, 26]. Altitude has an impact not only on the total headspace intensity, but also in the contribution of VOCs. The two ion fragments that change the most are m/z 45 and 59. This could also influence the aroma. At lower altitude, coffee will be more delicate, with more fruity, green (m/z 45) and buttery (m/z 59) notes [27]. This conclusion may be explained with the fact that the metabolism of coffee beans may change according to stress events, such as dry or cold climatic conditions [9, 15]. Accordingly, the growing conditions at high altitude may reflect a harsher environment and explain differences in total VOCs profile.

Effect of fermentation

The fermentation time leads to a great change in the total VOCs. This is expected, because fermentation affects the development of aroma precursors. Table 2 shows that longer fermentation times correspond to lower total VOCs. This is in agreement with studies [1]. The amount of free low molecular weight sugars and free amino acids is decreasing during fermentation, while increasing the phenolic compounds [11]. These processes are induced by the activity of isocitrate lyase (ICL) [15]. ICL is a key enzyme responsible for the production of many aroma precursors. According to the literature, the activity of ICL is maximum in the first 24–48 h, and then it fades down [15], which explains the lower amount of VOCs in coffee beans exposed to longer fermentation times.

The evolution of total VOCs is characterized by the great changes of a few mass fragments. These include m/z 61, 75, 45, 59, 81 and 97, tentatively identified as acetic acid, propionic acid, acetaldehyde, acetone, butene-2-one and furfural, respectively. Together, these ions accounted for 70% of the total VOCs signal. All these ions highly correlated with each other. As an example, Fig. 4 shows that the changes observed for the two mass ions with the highest intensity, respectively, the m/z 61 and 75, followed an exponential decay (R2 > 0.95). A similar behavior was observed for the other ions. Overall, these results confirm that prolonged fermentation time decreases the evolution of total VOCs, as expected from a lower activity of ICL and lower production of aroma precursors.

Fig. 4
figure 4

m/z 61 and 75 intensity of coffee harvested at 900 m and light roasted at different fermentation time

Effect of roasting

The roasting factor is known to generate in coffee a number of VOCs as products of Maillard, Strecker, hydrolysis and pyrolyis reactions [1, 3, 28]. Although we demonstrated that altitude and fermentation time could be important in developing specific VOC precursors, the final aroma taste is likely given during the roasting. Figure 5 shows that the greatest amount of VOCs is formed during medium (8 min) to long (10 min) stages of roasting level.

Fig. 5
figure 5

Total VOCs as a function of the roasting level

At any time, the highest signal intensity was always achieved with the m/z 61. However, other important fragments were detected, such as the m/z 75, 81 and 97. All are linearly correlated with the roasting level. Furthermore, the mass fragment m/z 97 was tentatively identified as furfural, a typical compound found in coffee. Together, these ions accounted for 70% of the total VOC signal.

Cherries grown at 900 m had an average size of 6.73 mm ± 0.46 mm in width and 8.76 mm ± 0.49 mm in length; the ones harvested at 1500 m measured in average 7.23 mm ± 0.75 mm in width and 8.06 mm ± 0.69 mm in length. Regarding the weight, 100 g of low-altitude beans weighed 16.54 g ± 0.17 g, while high-altitude beans weighed 17.35 g ± 0.19 g. Smaller beans may undergo the chemical reactions happening during the roasting process faster than the bigger ones, thus leading to a higher release of VOCs.

Prediction of total VOCs intensity

The total VOCs signal of coffee powder was used as an index for the overall aroma intensity. With this signal, a regression model was built to predict the total VOCs intensity of coffee samples as a function of the three environmental factors considered so far, i.e., harvesting altitude, fermentation time and roasting level. The samples were divided into a training set (80% of the samples) and test set (20% of the samples), respectively. With the training set, the resulting linear regression model was:

$$\begin{aligned} Y ( 10^{ 6} )& = {-}\;0. 4 1 {\text{ altitude }}{-} \, 0. 2 7 {\text{ fermentation }} + { 1}.0 3 {\text{ roasting }} + \, 0. 1 1 {\text{ altitude fermentation}}\,{-}\,0. 3 1 {\text{ altitude roasting}} \\ & \quad {-}\,0.0 7 {\text{ fermentation roasting }} + { 3}. 3. \\ \end{aligned}$$

The adjusted R2 was 0.89 and the normalized relative standard deviation was 6%. Validation of the model was performed on the test set (20% of the samples) by a fivefold cross-validation repeated ten times. The resulting adjusted R2 was 0.89 and the normalized relative standard deviation was 7%. The regression analysis confirmed that the most important variable was the roasting level, followed by its interaction with altitude. From this model, the highest total VOC value (which corresponds likely with the most intense aroma) can be achieved with coffee bean roasted for long times and grown at low altitude, and fermentation for short times. Conversely, the highest total VOC value (which corresponds likely with the most delicate aroma) can be achieved with coffee bean that is quickly roasted, fermented for longer times and grown at high altitudes.

Conclusion

The results of this study show the potential of PTR-MS as a rapid tool in the monitoring of the volatile profile of coffee powder with respect to harvesting and processing treatments. Regarding altitude, 900 m asl seems to be ideal, with respect to total VOC intensity, compared with 1500 m asl. Although the degree of roasting greatly affects the development of intense aroma levels, the results suggest that altitude and fermentation time also play a role in the formation of the volatile profile. Low altitude is characterized by a wetter and warmer climate compared to high altitude and these leads to the development of VOCs related to fruity, green and buttery notes, resulting in a more delicate aroma. Beans fermented for a prolonged period contain less acidic notes, less low molecular weight sugars and more phenolic compounds. These findings are in agreement with Bytof [29], who suggested that the chemical reactions happening in the seeds during their processing have a strong impact in the composition of flavor and therefore in the quality of coffee. The linear model that was developed in this study has huge potential to be applied in predicting the total VOCs intensity based on the altitude, fermentation time and roasting level. The suitability of PTR-MS together with the linear regression model could be a powerful tool in quality control for coffee industry. Further studies are desirable in the future to correlate these results with sensory analysis.